Hello i have read the other questions similar to this and they didn't help.
Can anyone see what the problem is?
When i run rspec spec i receive this error
No examples found.
Finished in 0.00027 seconds (files took 0.07589 seconds to load)
0 examples, 0 failures
Here is the tree structure
book.spec.rb
require 'spec_helper'
describe Book do
before :each do
@book = Book.new "Title", "Author", :category
end
describe "#new" do
it "returns a new book object"
@book.should be_an_instance_of Book
end
end
end
spec_helper.rb
require_relative '../library'
require_relative '../book'
require 'yaml'
I have ruby 2.2.1p85 Rails 4.2.3
The file name is wrong. You have book.spec.rb and it should be book_spec.rb.
Also:
$ rspec it will read all '*_spec' files on your spec/ folder.spec/models folder.You can read more about the standard structure of a Rails test suite here: http://www.relishapp.com/rspec/rspec-rails/v/3-3/docs/directory-structure
And this is a great place to learn about good practices about Rspec. http://betterspecs.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With