From 2f652ba783a4b8675a020955e494c64391eb0ab2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 19 Apr 2010 15:39:15 -0500 Subject: initial implementation --- t/002-url.t | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 t/002-url.t (limited to 't/002-url.t') diff --git a/t/002-url.t b/t/002-url.t new file mode 100644 index 0000000..22ffa1b --- /dev/null +++ b/t/002-url.t @@ -0,0 +1,35 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +BEGIN { + plan(skip_all => 'network tests disabled for shipped version') + unless $ENV{RELEASE_TESTING}; +} + +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; + ok(!-e $file, "json doesn't exist yet"); + $resource->install; + ok(-e $file, "json exists!"); + # minimal tests on the contents, since this url isn't versioned + like($file->slurp, qr+\Qhttp://www.JSON.org/json2.js+, + "got the json library"); + unlike($file->slurp, qr/\QRemove this line from json2.js before deployment/, + "the alert has been removed"); + chdir $oldcwd; +} + +done_testing; -- cgit v1.2.3-54-g00ecf