views:

43

answers:

0

UPDATE: It works now. I truly don't know what happened. I'll leave this Q up for some time, in case other experience the same. If not, I'll soon delete it.

TLDR: autotest rspec works with ruby1.8.7 but not in ruby1.9.2. Using rails3, rspec2, autotest 4.4.1. In 1.9.2, it doesn't do anything after starting autotest.

OK, now I'm real tired after hours of googling, am I an idiot missing out on something obvious?

To reproduce

$ rvm 1.9.2@rails3
$ rails new rspecdemo

Put this in the Gemfile

source 'http://rubygems.org'
gem 'rails', '3.0.1'
gem 'sqlite3-ruby', :require => 'sqlite3'
group :test, :development do
  gem "rspec"
  gem "rspec-rails"
  gem "autotest"
  gem "autotest-rails"
end

then

$ bundle install             #rspec 2.0.1 ++
$ rails g rspec:install      #creates the rspec dir ++
$ rails g scaffold products  #to get some stuff with tests
$ rake db:migrate
$ rake spec                  # OK runs all the specs

finally, autotest

$ autotest
loading autotest/rails

NOTHING HAPPENS here !! Yes, I'm changing files too...

What about Ruby 1.8.7 ?

$ rvm 1.8.7@rails3
$ bundle install
$ autotest
loading autotest/rails_rspec2
style: RailsRspec2
bundle exec /Users/olemortenamundsen/.rvm/rubies/ruby-1.8.7-p302/bin/ruby -S /Users/olemortenamundsen/.rvm/gems/ruby-1.8.7-p302@powestrails3/gems/rspec-core-2.0.1/bin/rspec --autotest '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/models/product_spec.rb' '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/views/products/edit.html.erb_spec.rb' '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/requests/products_spec.rb' '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/views/products/show.html.erb_spec.rb' '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/views/products/new.html.erb_spec.rb' '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/routing/products_routing_spec.rb' '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/views/products/index.html.erb_spec.rb' '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/helpers/products_helper_spec.rb' '/Users/olemortenamundsen/dev/temp/rspecdemo/spec/controllers/products_controller_spec.rb'
/Users/olemortenamundsen/.rvm/gems/ruby-1.8.7-p302@powestrails3/gems/rspec-expectations-2.0.1/lib/rspec/expectations/fail_with.rb:29:in `fail_with': expected: false, (RSpec::Expectations::ExpectationNotMetError)
 got: true (using ==)
... and so on.

So that works, without any code changes in my project.

Anybody using autotest with ruby 1.9.2? Thanks for helping!