Reputation: 9329
I have the following rspec example:
describe "with spike" do
it "succeeds" do
a = double('whatever')
a.should_receive(:b).with(true)
a.b('not false')
end
end
How can I make with
accept any non-false argument?
Upvotes: 0
Views: 32
Reputation: 378
Just write an arbitrary message handler:
describe "with spike" do
it "succeeds" do
a = double('whatever')
a.should_receive(:b) { |x|
x.should_not be_false
}
a.b('not false')
end
end
Upvotes: 1