我用黄瓜和水豚
对于步骤:
Then /I should see movies of rating 'PG' or 'R'/ do page.body.should match(/<td>PG<\/td>/) page.body.should match(/<td>R<\/td>/) end
黄瓜错误:
undefined method `match' for #<Cucumber::Rails::World:...> (NoMethodError) ./features/step_deFinitions/movie_steps.rb:37:in `/I should see movies of rating 'PG' or 'R'/'
对于步骤:
Then /I should see an empty table/ do page.body.scan(/<tr>/).length.should == 0 end
黄瓜错误:
undefined method `should' for 1:Fixnum (NoMethodError) ./features/step_deFinitions/movie_steps.rb:46:in `/I should see an empty table/'
并为步骤:
Then /I should see all of the movies/ do Movie.find(:all).length.should page.body.scan(/<tr>/).length end undefined method `should' for 10:Fixnum (NoMethodError) ./features/step_deFinitions/movie_steps.rb:59:in `/I should see all of the movies/'
正如您所看到的,这些错误非常相似,但我无法理解导致此问题的原因.
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。