From cf3ed738309b34d84d492f0873d296b54f3e21a6 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 15 Feb 2008 18:51:02 +0000 Subject: [PATCH] Fix a bad use test in Shop/Tax.t Begin Tax.pm, using Class::InsideOut with a basic constructor and a session method. --- lib/WebGUI/Shop/Tax.pm | 55 ++++++++++++++++++++++++++++++++++++++++++ t/Shop/Tax.t | 3 ++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 lib/WebGUI/Shop/Tax.pm diff --git a/lib/WebGUI/Shop/Tax.pm b/lib/WebGUI/Shop/Tax.pm new file mode 100644 index 000000000..8c4679241 --- /dev/null +++ b/lib/WebGUI/Shop/Tax.pm @@ -0,0 +1,55 @@ +package WebGUI::Shop::Tax; + +use strict; + +use Class::InsideOut qw{ :std }; + +=head1 NAME + +Package WebGUI::Shop::Tax + +=head1 DESCRIPTION + +This package manages tax information, and calculates taxes on a shopping cart. + +=head1 SYNOPSIS + + use WebGUI::Shop::Tax; + + my $tax = WebGUI::Shop::Tax->new($session); + +=head1 METHODS + +These subroutines are available from this package: + +=cut + +readonly session => my %session; + +#------------------------------------------------------------------- + +=head2 new ( $session ) + +Constructor for the WebGUI::Shop::Tax. Returns a WebGUI::Shop::Tax object. + +=cut + +sub new { + my $class = shift; + my $session = shift; + my $self = {}; + bless $self, $class; + register $self; + $session{ id $self } = $session; + return $self; +} + +#------------------------------------------------------------------- + +=head2 session ( ) + +Accessor for the session object. Returns the session object. + +=cut + +1; diff --git a/t/Shop/Tax.t b/t/Shop/Tax.t index c2b36e1b4..b4c0c0c20 100644 --- a/t/Shop/Tax.t +++ b/t/Shop/Tax.t @@ -33,9 +33,10 @@ plan tests => 1 + $tests; #---------------------------------------------------------------------------- # put your tests here -my $loaded = use_ok('WebGUI::Shop::Tax', 'Tax module loaded'); +my $loaded = use_ok('WebGUI::Shop::Tax'); SKIP: { + skip 'Unable to load module WebGUI::Shop::Tax', $tests unless $loaded; my $taxer = WebGUI::Shop::Tax->new($session);