test/test_helper.rb in active_fulfillment-2.1.1 vs test/test_helper.rb in active_fulfillment-2.1.2

- old
+ new

@@ -3,20 +3,20 @@ require 'rubygems' require 'bundler' Bundler.setup -require 'test/unit' +require 'minitest/autorun' require 'digest/md5' require 'active_fulfillment' require 'active_utils' require 'mocha/setup' module Test module Unit - class TestCase + class TestCase < MiniTest::Unit::TestCase include ActiveMerchant::Fulfillment LOCAL_CREDENTIALS = ENV['HOME'] + '/.active_merchant/fixtures.yml' unless defined?(LOCAL_CREDENTIALS) DEFAULT_CREDENTIALS = File.dirname(__FILE__) + '/fixtures.yml' unless defined?(DEFAULT_CREDENTIALS) @@ -45,9 +45,21 @@ def symbolize_keys(hash) return unless hash.is_a?(Hash) hash.symbolize_keys! hash.each{|k,v| symbolize_keys(v)} + end + + def assert_raise(error) + begin + yield + rescue => e + flunk "Expected #{error} but nothing raised" if e.class != error + end + end + + def assert_nothing_raised + yield end end end end