From c16d34fa7b67ad1e5db7a098e74c5f711e222403 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 12 Jan 2011 13:31:51 -0500 Subject: Fix some bugs in jitterbug::Emailer and add mocked test data --- t/006_emailer.t | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/006_emailer.t b/t/006_emailer.t index cc343d1..2df25f1 100644 --- a/t/006_emailer.t +++ b/t/006_emailer.t @@ -2,12 +2,24 @@ use strict; use warnings; use Test::Most tests => 3; use Data::Dumper; +use Test::MockObject; use_ok "jitterbug::Emailer"; { - my $conf = { foo => 'bar' }; - my $task = {}; + my $conf = { jitterbug => { build_process => 'bar'} }; + my $commit = Test::MockObject->new; + my $project = Test::MockObject->new; + my $task = Test::MockObject->new; + + $project->mock('name', sub { 'ponie' }); + + $commit->mock('sha256', sub { 'c0decafe' }); + $commit->mock('content', sub { 'this should be JSON' } ); + + $task->mock('commit', sub { $commit }); + $task->mock('project', sub { $project }); + my $tap = "1..1\nok 1\n"; my $e = jitterbug::Emailer->new($conf, $task, $tap); -- cgit v1.2.3