summaryrefslogtreecommitdiffstats
path: root/t/02-extension.t
diff options
context:
space:
mode:
Diffstat (limited to 't/02-extension.t')
-rw-r--r--t/02-extension.t16
1 files changed, 8 insertions, 8 deletions
diff --git a/t/02-extension.t b/t/02-extension.t
index 0136b1a..5e88fa6 100644
--- a/t/02-extension.t
+++ b/t/02-extension.t
@@ -20,7 +20,7 @@ use Test::Fatal;
return $self;
}
- sub add_package_symbol {
+ sub add_symbol {
my ($self, $variable, $initial_value) = @_;
(my $name = $variable) =~ s/^[\$\@\%\&]//;
@@ -38,26 +38,26 @@ isa_ok($foo_stash, 'My::Package::Stash');
isa_ok($foo_stash, 'Package::Stash');
ok(!defined($Foo::{foo}), '... the %foo slot has not been created yet');
-ok(!$foo_stash->has_package_symbol('%foo'), '... the foo_stash agrees');
+ok(!$foo_stash->has_symbol('%foo'), '... the foo_stash agrees');
is(exception {
- $foo_stash->add_package_symbol('%foo' => { one => 1 });
+ $foo_stash->add_symbol('%foo' => { one => 1 });
}, undef, '... the %foo symbol is created succcessfully');
ok(!defined($Foo::{foo}), '... the %foo slot has not been created in the actual Foo package');
-ok($foo_stash->has_package_symbol('%foo'), '... the foo_stash agrees');
+ok($foo_stash->has_symbol('%foo'), '... the foo_stash agrees');
-my $foo = $foo_stash->get_package_symbol('%foo');
+my $foo = $foo_stash->get_symbol('%foo');
is_deeply({ one => 1 }, $foo, '... got the right package variable back');
$foo->{two} = 2;
-is($foo, $foo_stash->get_package_symbol('%foo'), '... our %foo is the same as the foo_stashs');
+is($foo, $foo_stash->get_symbol('%foo'), '... our %foo is the same as the foo_stashs');
ok(!defined($Foo::{bar}), '... the @bar slot has not been created yet');
is(exception {
- $foo_stash->add_package_symbol('@bar' => [ 1, 2, 3 ]);
+ $foo_stash->add_symbol('@bar' => [ 1, 2, 3 ]);
}, undef, '... created @Foo::bar successfully');
ok(!defined($Foo::{bar}), '... the @bar slot has still not been created');
@@ -65,7 +65,7 @@ ok(!defined($Foo::{bar}), '... the @bar slot has still not been created');
ok(!defined($Foo::{baz}), '... the %baz slot has not been created yet');
is(exception {
- $foo_stash->add_package_symbol('%baz');
+ $foo_stash->add_symbol('%baz');
}, undef, '... created %Foo::baz successfully');
ok(!defined($Foo::{baz}), '... the %baz slot has still not been created');