summaryrefslogtreecommitdiffstats
path: root/t/001-bundled.t
diff options
context:
space:
mode:
Diffstat (limited to 't/001-bundled.t')
-rw-r--r--t/001-bundled.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/001-bundled.t b/t/001-bundled.t
new file mode 100644
index 0000000..fc3213f
--- /dev/null
+++ b/t/001-bundled.t
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Cwd;
+use File::Temp;
+use Path::Class;
+
+use Resource::Pack::JSON;
+
+{
+ my $oldcwd = getcwd;
+ my $dir = File::Temp->newdir;
+ chdir $dir;
+ my $file = file('json2.js');
+
+ my $resource = Resource::Pack::JSON->new(use_bundled => 1);
+ ok(!-e $file, "json doesn't exist yet");
+ $resource->install;
+ ok(-e $file, "json exists!");
+ like($file->slurp, qr/2010-03-20/,
+ "got the right json version");
+ like($file->slurp, qr/\Qif (!this.JSON) {/,
+ "got something that looks like json2.js");
+ unlike($file->slurp, qr/Remove this line from json2\.js before deployment/,
+ "the alert has been removed");
+ chdir $oldcwd;
+}
+
+done_testing;