This seems to be mostly asked question, I have an application when run in both rake spec and rspec the output seems to be different. When rspec spec -p command is used 0 failures message is displayed while when rake spec is used few errors are displayed.
3
votes
Can you provide more details like what is your rake output?
- Erez Rabih
after running rspec spec -p 0 failures while rake spec gives me errors and its always changing 1 failure, 3 failures and sometime no failure pls help, is rspec better than rake spec? don know abt these stuffs pls help :-)
- Abhishek Thayyil
What errors specifically? Without that information it's gonna be pretty difficult for people to help.
- muttonlamb
thx for ur reply the error that i am coming across is ActiveRecord::JDBCError: Cannot add or update a child row: a foreign key constraint fails
- Abhishek Thayyil
1 Answers
0
votes
When you run $ bundle exec rspec # (defaults to spec), all the files in the ./spec directory are executed.
When you run $ bundle exec rake spec, you're executing all of the rake tasks named 'spec' from all the gems and from their dependencies.
Also the environment under which tests are executed may vary accordingly to those files. Don't wonder if you face different outputs.