Commits

Toby Inkster committed 1edd132 Draft

test build_exporter function

Comments (0)

Files changed (1)

t/07build_exporter.t

+use Test::More tests => 3;
+
+BEGIN {
+	package Local::Exporter;
+	use Exporter::Everything ();
+	sub a { 42 }
+	my $importer = Exporter::Everything::build_exporter();
+	*import = sub {
+		::pass("ran custom import sub");
+		goto $importer;
+	};
+	no thanks;
+}
+
+BEGIN {
+	package Local::Importer;
+	use Local::Exporter;
+	no thanks;
+}
+
+can_ok('Local::Importer', 'a');
+is(Local::Importer->a, '42');
+