[Rt-commit] rt branch, squish-refactor, updated. rt-3.9.7-878-g42c57da

? sunnavy sunnavy at bestpractical.com
Wed Dec 15 02:47:09 EST 2010


The branch, squish-refactor has been updated
       via  42c57da1c3e5301bddbcd5232b5cb5991e2f83dd (commit)
      from  554a047fcc9a302ae9ddc376aa9e7d45d1905236 (commit)

Summary of changes:
 t/api/squish.t |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 t/api/squish.t

- Log -----------------------------------------------------------------
commit 42c57da1c3e5301bddbcd5232b5cb5991e2f83dd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Dec 15 15:46:44 2010 +0800

    squish base class api test

diff --git a/t/api/squish.t b/t/api/squish.t
new file mode 100644
index 0000000..526c930
--- /dev/null
+++ b/t/api/squish.t
@@ -0,0 +1,26 @@
+use strict;
+use warnings;
+use RT;
+use RT::Test nodb => 1, tests => 10;
+
+use RT::Squish;
+use File::Temp 'tempfile';
+
+my ( $fh1, $file1 ) = tempfile( 'rttestXXXXXX', UNLINK => 1, TMPDIR => 1 );
+print $fh1 "this is file1\n";
+close $fh1;
+my ( $fh2, $file2 ) = tempfile( 'rttestXXXXXX', UNLINK => 1, TMPDIR => 1 );
+print $fh2 "this is file2\n";
+close $fh2;
+
+my $squish = RT::Squish->new( Name => 'foo', Files => [ $file1, $file2 ]  );
+for my $method ( qw/Name Files Content ModifiedTime Key/ ) {
+    can_ok($squish, $method);
+}
+
+is( $squish->Name, 'foo', 'Name' );
+is_deeply( $squish->Files, [ $file1, $file2 ], 'Files' );
+is( $squish->Content, "this is file1\nthis is file2\n", 'Content' );
+like( $squish->Key, qr/[a-f0-9]{32}/, 'Key is like md5' );
+ok( (time()-$squish->ModifiedTime) <= 2, 'ModifiedTime' );
+

-----------------------------------------------------------------------


More information about the Rt-commit mailing list