RSpec : spec filename should end with _spec

It is important to end filename of every spec files for RSpec with prefix ‘_spec.rb’. You can try it out. The RSpec only executes the specs if filename ends with ‘_spec.rb’ else it ignores the file even if it is a ruby file.

The issue was the filename of the spec file
I should have been
`spec/cancan/ability_spec.rb` but there was
`spec/cancan/ability.rb`

and I should have invoked
`bundle exec rspec spec/cancan/ability_spec.rb`

The issue was the filename of the spec file
I should have been
`spec/cancan/ability_spec.rb` but there was
`spec/cancan/ability.rb`

and I should have invoked
`bundle exec rspec spec/cancan/ability_spec.rb`

For more details please visit this link

http://stackoverflow.com/questions/32600720/i-was-trying-write-permissions-specs-for-cancan-by-ryanbates-but-got-error-unin

http://stackoverflow.com/questions/14180003/rspec-naming-conventions-for-files-and-directory-structure#answer-14208073

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s