1
Я использую Rspec версии 3, и у меня проблема с has_attributes matcher.Rspec has_attributes matcher
Код я тестирую:
it 'will match class instances with #have_attributes' do
Person = Struct.new(:name, :age)
person = Person.new("Jim", 32)
expect(person).to have_attributes(:name => "Jim", :age => 32)
end
Но я получил эту ошибку:
Failure/Error: expect(person).to have_attributes(:name => "Jim", :age => 32)
expected #<struct Person name="Jim", age=32> to respond to `has_attributes?`
Благодарности