I installed RSpec 2 along RSpec 1.3 and since then I think the spec command runs without executing the test file. I removed RSpec 2 and am using RSpec 1.3 again. I type for example "spec spec/views/messages/show.html.erb_spec.rb" on the commandline and the c开发者_开发百科ommand returns after a few seconds without output. I added errors to the spec file and it seems the file is not read/executed by RSpec.
Does anyone know the reason for this behaviour?
I resolved it by removing all installed gems and installed the necessary ones again. (gem list | cut -d" " -f1 | xargs gem uninstall -aIx)
there are a lot of changes in rspec2, for one the command spec
is replaced by rspec
(i guess that explains your experienced behaviour). Rspec2 is not completely backwards compatible.
You can find a complete list here.
If you are using Rails 3 you will have to use Rspec2.
The transition is not entirely painless, but it should not be too much of a hassle. I started a new project in Rails 3 with Rspec2 and the integration of rails and rspec is now much better. Great :)
精彩评论