I am learning Ruby and have to do some homework, but have problem with executing code. I searched this forum and Google and found that this could be problem with different Ruby versions but I don’t know how to fix this. I’ve tried to execute:
cucumber features/filter_movie_list.feature
and got this:
And I should not see ‘G’ #
features/step_definitions/movie_steps.rb:32
no such file to load — rspec/matchers/built_in/has (LoadError)
./features/step_definitions/movie_steps.rb:34:in/^(?:|I )should not see '([^']*)'$/'And I should not see ‘G”
features/filter_movie_list.feature:37:in
Can someone help me to solve this problem or give me link to solution?
EDIT:
movie_steps.rb relevant for this taks is:
Then /^(?:|I )should not see '([^']*)'$/ do |text|
if page.respond_to? :should
page.find('#movies').should have_no_content(text)
else
assert page.find('#movies').has_no_content?(text)
end
end
The error message says that Cucumber can’t find RSpec.
To solve it, edit your Gemfile and add these and that should solve it.
If that does solve it, you can probably remove all those lines except the first one (the ‘rspec’ one) because that line should take care of the others.