summaryrefslogtreecommitdiffstats
path: root/t/001-bundled.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-04-19 15:39:15 -0500
committerJesse Luehrs <doy@tozt.net>2010-04-19 15:39:15 -0500
commit2f652ba783a4b8675a020955e494c64391eb0ab2 (patch)
treeb1e6f0ee404fc911017d123a9c85559964c938cb /t/001-bundled.t
parent549b2365930137f85799ee1975b4b43dbdbdd290 (diff)
downloadresource-pack-json-2f652ba783a4b8675a020955e494c64391eb0ab2.tar.gz
resource-pack-json-2f652ba783a4b8675a020955e494c64391eb0ab2.zip
initial implementation
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;