From dc9f255ebfe2aa022264f4c2a53f80a98f392122 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 4 Jul 2011 12:40:55 +0200 Subject: Prepare for more advanced App::Raps2 tests --- t/25-app-raps2-basic.t | 30 ++++++++++++++++++++++++++++++ t/29-app-raps2.t | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 t/25-app-raps2-basic.t delete mode 100644 t/29-app-raps2.t (limited to 't') diff --git a/t/25-app-raps2-basic.t b/t/25-app-raps2-basic.t new file mode 100644 index 0000000..53aa51d --- /dev/null +++ b/t/25-app-raps2-basic.t @@ -0,0 +1,30 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.010; + +use Test::More; + +eval "use Test::MockObject"; +plan skip_all => 'Test::MockObject required' if $@; + +plan tests => 4; + +my $mock = Test::MockObject->new(); +$mock->fake_module( + 'Term::ReadLine', + new => sub { return bless({}, $_[0]) }, +); + +use_ok('App::Raps2'); + +my $r2 = App::Raps2->new( dont_touch_fs => 1 ); +isa_ok($r2, 'App::Raps2'); + +isa_ok($r2->ui(), 'App::Raps2::UI'); + +is_deeply( + $r2->file_to_hash('t/in/hash'), + { key => 'value', otherkey => 'othervalue' }, + 'file_to_hash works', +); diff --git a/t/29-app-raps2.t b/t/29-app-raps2.t deleted file mode 100644 index 53aa51d..0000000 --- a/t/29-app-raps2.t +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.010; - -use Test::More; - -eval "use Test::MockObject"; -plan skip_all => 'Test::MockObject required' if $@; - -plan tests => 4; - -my $mock = Test::MockObject->new(); -$mock->fake_module( - 'Term::ReadLine', - new => sub { return bless({}, $_[0]) }, -); - -use_ok('App::Raps2'); - -my $r2 = App::Raps2->new( dont_touch_fs => 1 ); -isa_ok($r2, 'App::Raps2'); - -isa_ok($r2->ui(), 'App::Raps2::UI'); - -is_deeply( - $r2->file_to_hash('t/in/hash'), - { key => 'value', otherkey => 'othervalue' }, - 'file_to_hash works', -); -- cgit v1.2.3