summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-06-14 10:46:46 -0500
committerJesse Luehrs <doy@tozt.net>2011-06-14 10:46:46 -0500
commit3edca453f642917f53c6fbfa59683fd70204813d (patch)
tree4671fb39b35c8b218e3b53d074bee650e9c69496 /t
parent08127efc8a27fca6d6126229fa5c2954bab43843 (diff)
downloadsub-exporter-declare-3edca453f642917f53c6fbfa59683fd70204813d.tar.gz
sub-exporter-declare-3edca453f642917f53c6fbfa59683fd70204813d.zip
initial sketch
Diffstat (limited to 't')
-rw-r--r--t/basic.t45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/basic.t b/t/basic.t
new file mode 100644
index 0000000..09ba03f
--- /dev/null
+++ b/t/basic.t
@@ -0,0 +1,45 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN {
+ package My::Exporter;
+ use Sub::Exporter::Sugar;
+
+ export 'foo';
+ export_default 'bar';
+
+ sub foo {
+ return "foo";
+ }
+
+ sub bar {
+ return "bar";
+ }
+
+ $INC{'My/Exporter.pm'} = 1;
+}
+
+{
+ package Foo;
+ use My::Exporter;
+ ::ok(!Foo->can('foo'));
+ ::is(bar(), 'bar');
+}
+
+{
+ package Bar;
+ use My::Exporter 'foo';
+ ::is(foo(), 'foo');
+ ::ok(!Bar->can('bar'));
+}
+
+{
+ package Baz;
+ use My::Exporter ':all';
+ ::is(foo(), 'foo');
+ ::is(bar(), 'bar');
+}
+
+done_testing;