Vote count:
0
I have the following example:
it 'receives message' do
expect(Foo).to receive(:bar).with(baz)
OtherClass.send(baz)
end
class OtherClass
def self.send(baz)
Foo.bar(1) # this first one is the problem
Foo.bar(baz)
end
end
class Foo
def self.bar(whatever)
puts whatever + " was received"
end
end
This is the error:
Failure/Error: Foo received :bar with unexpected arguments
asked 1 min ago
Rspec how to expect to receive a message "with", when object receives message twice?
Aucun commentaire:
Enregistrer un commentaire