[mocha-developer] only checking certain parameters for a method

Steve Eichert steve.eichert at gmail.com
Wed Jun 20 23:55:08 EDT 2007


I'm writing a test where I only care about one of the parameters being sent
to the method, does anyone think having a way to say that any value for a
parameter which I don't care about is valid?  I'm thinking something like:

def test_charge_is_for_10_bucks
    gateway = test_gateway
    member = Member.new
    member.credit_card_number = "1"
    member.expiration_date = "9/19/2007"
    member.payment_method = "bogus"
    member.first_name = "Steve"
    member.last_name = "Eichert"
    member.expects(:active_merchant_gateway).returns(gateway)
    member.expects(:purchase).with(1000, :any).returns(TestResponse.new)
    member.charge
end

On a slightly unrelated note, I was trying to find a way to search the
mailing list archives here:
http://rubyforge.org/pipermail/mocha-developer/but wasn't able to
figure anything out.  Does anyone have any suggestions?

Cheers,
Steve


More information about the mocha-developer mailing list