root/branches/boomer/t/10-filemgr.t @ 1098

Revision 1098, 1.0 kB (checked in by hachi, 2 years ago)

Branching for boomer from release-19, rev 62318

  • Property svn:mime-type set to text/plain
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/usr/bin/perl
2# $Id$
3use strict;
4use warnings;
5use lib 't/lib', 'extlib', 'lib', '../lib', '../extlib';
6use Test::More tests => 13;
7
8use MT;
9use MT::FileMgr;
10
11my $File = 'test.file';
12my $String = 'testing';
13
14my $fmgr = MT::FileMgr->new('Local');
15isa_ok($fmgr, 'MT::FileMgr');
16ok($fmgr->can_write('.'), 'can_write');
17ok($fmgr->content_is_updated($File, \$String), "content_is_updated($File,$String)");
18
19ok($fmgr->put_data($String, $File), "put_data($String, $File)");
20ok(!$fmgr->content_is_updated($File, \$String), "content_is_updated($File,$String)");
21my $str2 = $String . 'bar';
22ok($fmgr->content_is_updated($File, \$str2), "content_is_updated($File,$str2)");
23ok($str2, $String . 'bar');
24
25my($copy) = $String = "bjæ·¡rn";
26ok($fmgr->put_data($String, $File), "put_data($String, $File)");
27ok(!$fmgr->content_is_updated($File, \$String), "content_is_updated($File,$String)");
28is($copy, $String, "$copy is $String");
29
30ok(-f $File, "$File is a regular file");
31ok($fmgr->delete($File), "delete($File)");
32ok(!-f $File, "$File is gone");
Note: See TracBrowser for help on using the browser.