Thanks Gavin. I thought this session was really useful, interesting and I definitely learnt from it. I think we should definitely do this again in the future.
I do have a question related to your setup which you might be able to help with or maybe point me in the right direction. I've setup Guard and Guard-rspec (also their dependents: growlnotify, growl gem and rb-fsevent gem) for a rails 3 app. If I run my specs with "$ rake spec" they all pass. If however I run "$ guard" it tries running the specs but raises an error (see below). Looking at the stack trace it isn't due to a failing test as it seems to be while loading the spec files. It looks like it's database related as it's failing due to an ActiveRecord uniqueness validation error. So, do you know if guard-rspec runs specs in a different mode or with different options to the rake task? I'm just using the generated Guardfile (but I have tried tweaking with these options).
Any ideas?
Cheers
Andy
==================================Stack trace==================================
Andrew-Pikes-iMac:feedbackize andy$ guard
Guard is now watching at '/Users/andy/Documents/Ruby/feedbackize'
Guard::RSpec is running, with RSpec 2!
Running all specs
/Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.6/lib/active_record/validations.rb:49:in `save!': Validation failed: Nickname The nickname person1 has already been taken (ActiveRecord::RecordInvalid)
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.6/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.6/lib/active_record/transactions.rb:245:in `block in save!'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.6/lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.6/lib/active_record/transactions.rb:207:in `transaction'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.6/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.6/lib/active_record/transactions.rb:245:in `save!'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/proxy/create.rb:6:in `result'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:330:in `run'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:273:in `create'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/proxy/build.rb:17:in `associate'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/attribute/association.rb:15:in `add_to'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:327:in `block in run'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:325:in `each'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:325:in `run'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:253:in `build'
from /Users/andy/Documents/Ruby/feedbackize/spec/factories.rb:39:in `block in <top (required)>'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:56:in `define'
from /Users/andy/Documents/Ruby/feedbackize/spec/factories.rb:37:in `<top (required)>'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `block in require'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:227:in `load_dependency'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `require'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:310:in `block in find_definitions'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:308:in `each'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-1.3.3/lib/factory_girl/factory.rb:308:in `find_definitions'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl_rails-1.0.1/lib/factory_girl_rails/railtie.rb:11:in `block in <class:Railtie>'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:34:in `call'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.6/lib/rails/application/finisher.rb:46:in `block in <module:Finisher>'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.6/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.6/lib/rails/initializable.rb:25:in `run'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.6/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.6/lib/rails/initializable.rb:49:in `each'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.6/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.6/lib/rails/application.rb:134:in `initialize!'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.6/lib/rails/application.rb:77:in `method_missing'
from /Users/andy/Documents/Ruby/feedbackize/config/environment.rb:5:in `<top (required)>'
from /Users/andy/Documents/Ruby/feedbackize/spec/spec_helper.rb:6:in `require'
from /Users/andy/Documents/Ruby/feedbackize/spec/spec_helper.rb:6:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /Users/andy/Documents/Ruby/feedbackize/spec/controllers/application_controller_spec.rb:1:in `<top (required)>'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `block in load_spec_files'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `map'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load_spec_files'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:18:in `run'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in `run'
from /Users/andy/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `block in autorun'