Rework build_subs(), thanks to Michal Schwern, closes: CPAN#22073
authorIvan Kohler <ivan@freeside.biz>
Tue, 25 Feb 2014 08:20:03 +0000 (00:20 -0800)
committerIvan Kohler <ivan@freeside.biz>
Tue, 25 Feb 2014 08:20:03 +0000 (00:20 -0800)
t/override.t [new file with mode: 0644]

diff --git a/t/override.t b/t/override.t
new file mode 100644 (file)
index 0000000..d35c4fd
--- /dev/null
@@ -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 $@, '';