diff --git a/lib/WebGUI/Shop/Ship.pm b/lib/WebGUI/Shop/Ship.pm index 482672e06..6a4886d32 100644 --- a/lib/WebGUI/Shop/Ship.pm +++ b/lib/WebGUI/Shop/Ship.pm @@ -73,7 +73,8 @@ sub addShipper { unless exists $self->getDrivers->{$requestedClass}; WebGUI::Error::InvalidParam->throw(error => q{You must pass a hashref of options to create a new ShipDriver object}) unless defined($options) and ref $options eq 'HASH' and scalar keys %{ $options }; - my $driver = eval { WebGUI::Pluggable::instanciate($requestedClass, 'create', [ $self->session, $options ]) }; + my $driver = eval { WebGUI::Pluggable::instanciate($requestedClass, 'new', [ $self->session, $options ]) }; + $driver->write; return $driver; } diff --git a/t/Shop/Ship.t b/t/Shop/Ship.t index d139316a1..d5eb85661 100644 --- a/t/Shop/Ship.t +++ b/t/Shop/Ship.t @@ -124,13 +124,13 @@ cmp_deeply( eval { $shipper = $ship->addShipper('WebGUI::Shop::ShipDriver::FlatRate', {}); }; $e = Exception::Class->caught(); -isa_ok($e, 'WebGUI::Error::InvalidParam', 'addShipper croaks without options to build a object with'); +isa_ok($e, 'WebGUI::Error::InvalidParam', 'addShipper croaks with empty options to build a object with'); cmp_deeply( $e, methods( error => 'You must pass a hashref of options to create a new ShipDriver object', ), - 'addShipper croaks without options to build a object with', + 'addShipper croaks with empty options to build a object with', ); my $driver = $ship->addShipper('WebGUI::Shop::ShipDriver::FlatRate', { enabled=>1, label=>q{Jake's Jailbird Airmail}, groupToUse=>7});