我无法理解为什么下面的代码块没有通过,即使puts值显示我正在检查的值:
let(:new_on_each_example) { MovieList.new }
it "can use method defined by 'let'" do
new_on_each_example.should_not be_nil
# the object is memoized, so
new_on_each_example.should == new_on_each_example
puts new_on_each_example.class
new_on_each_example.class.should == "MovieList"
end
控制台显示:
MovieList
预期:“MovieList”得到:MovieList(id:整数,标题:字符串,created_at:datetime,updated_at:datetime,track_number:整数)(使用==)
Puts显示我正在寻找的值,但测试失败。 为什么是这样?