0
是否有可能通過主體屬性,像這樣循環:如何遍歷RSpec中的主題屬性?
subject { assignment }
its(:submissions).each do |submission|
submission.grade should eq 100
end
我得到的錯誤是Undefined method each for Class ...
我也試過
subject { assignment }
its(:submissions) do
each do |submission|
submission.grade should eq 100
end
end
,並得到
未定義的方法'each'for RSpec :: Core :: ExampleGroup :: Nested_4 :: Nested_4 :: Nested_1 :: Nested_1:0x00000005f91ac8