MiniTest::Assertions returning false for test that should be returning true

I am attempting to learn MiniTest and by doing so I have started testing one of my applications that uses the PayPal API to approve/deny credit-card payments. Below is my attempt at testing the purchase method inside the Payment class. (credit_card was originally a private method, moved to public for testing)

MiniTest::Assertionsassert method call uses the syntax assert(test, msg = nil) The reason your test is returning true is that is the message you chose to use. The assert_equal method takes 2 values to compare. Also, instead of making the private method public, you can use the .send method like this:

assert @purchase.send(:credit_card,@card_info).valid?

Also, change the setup to a function definition:

def setup
# setup logic
end

To make the output more verbose (capture the ActiveMerchant errors), try the following: