From: Ivan Kohler Date: Tue, 25 Feb 2014 08:20:03 +0000 (-0800) Subject: Rework build_subs(), thanks to Michal Schwern, closes: CPAN#22073 X-Git-Url: http://git.freeside.biz/gitweb/?p=Business-OnlinePayment.git;a=commitdiff_plain;h=1f026592e56ef261c549e8d01491bd89e4d550da Rework build_subs(), thanks to Michal Schwern, closes: CPAN#22073 --- diff --git a/t/override.t b/t/override.t new file mode 100644 index 0000000..d35c4fd --- /dev/null +++ b/t/override.t @@ -0,0 +1,24 @@ +#!/usr/bin/perl -w + +use Test::More tests => 2; + +{ # fake test driver (with submit method) + + package Business::OnlinePayment::MOCK; + use strict; + use warnings; + use base qw(Business::OnlinePayment); + sub test_transaction { + my $self = shift; + return $self->SUPER::test_transaction(@_); + } +} + +$INC{"Business/OnlinePayment/MOCK.pm"} = "testing"; + +my $tx = Business::OnlinePayment->new("MOCK"); +is eval { + $tx->test_transaction(1); + $tx->test_transaction; +}, 1; +is $@, '';