Fix a bad use test in Shop/Tax.t

Begin Tax.pm, using Class::InsideOut with a basic constructor and a session method.
This commit is contained in:
Colin Kuskie 2008-02-15 18:51:02 +00:00
parent a476909952
commit cf3ed73830
2 changed files with 57 additions and 1 deletions

55
lib/WebGUI/Shop/Tax.pm Normal file
View file

@ -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;

View file

@ -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);