root/branches/release-40/t/10-filemgr.t @ 2562

Revision 2562, 1.0 kB (checked in by bchoate, 18 months ago)

Test suite cleanup. Use MT::Test to force t/ based configuration file for all tests. Fixed several tests that had incorrect expected values.

  • 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::Test;
10use MT::FileMgr;
11
12my $File = 'test.file';
13my $String = 'testing';
14
15my $fmgr = MT::FileMgr->new('Local');
16isa_ok($fmgr, 'MT::FileMgr');
17ok($fmgr->can_write('.'), 'can_write');
18ok($fmgr->content_is_updated($File, \$String), "content_is_updated($File,$String)");
19
20ok($fmgr->put_data($String, $File), "put_data($String, $File)");
21ok(!$fmgr->content_is_updated($File, \$String), "content_is_updated($File,$String)");
22my $str2 = $String . 'bar';
23ok($fmgr->content_is_updated($File, \$str2), "content_is_updated($File,$str2)");
24ok($str2, $String . 'bar');
25
26my($copy) = $String = "bjæ·¡rn";
27ok($fmgr->put_data($String, $File), "put_data($String, $File)");
28ok(!$fmgr->content_is_updated($File, \$String), "content_is_updated($File,$String)");
29is($copy, $String, "$copy is $String");
30
31ok(-f $File, "$File is a regular file");
32ok($fmgr->delete($File), "delete($File)");
33ok(!-f $File, "$File is gone");
Note: See TracBrowser for help on using the browser.