[Bps-public-commit] r15687 - in Prophet/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Mon Sep 1 21:02:30 EDT 2008


Author: sartak
Date: Mon Sep  1 21:02:29 2008
New Revision: 15687

Added:
   Prophet/trunk/t/publish-html.t
Modified:
   Prophet/trunk/   (props changed)

Log:
 r70844 at onn:  sartak | 2008-09-01 21:02:18 -0400
 Very basic tests for publish-html


Added: Prophet/trunk/t/publish-html.t
==============================================================================
--- (empty file)
+++ Prophet/trunk/t/publish-html.t	Mon Sep  1 21:02:29 2008
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Prophet::Test tests => 12;
+use Test::Exception;
+use File::Temp 'tempdir';
+use Path::Class;
+use Params::Validate;
+
+my ($bug_uuid, $pullall_uuid);
+
+my $alice_published = tempdir(CLEANUP => 1);
+
+as_alice {
+    run_output_matches( 'prophet',
+        [qw(create --type Bug -- --status new --from alice --summary), 'this is a template test'],
+        [qr/Created Bug \d+ \((\S+)\)(?{ $bug_uuid = $1 })/],
+        "Created a Bug record as alice");
+    ok($bug_uuid, "got a uuid for the Bug record");
+    run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
+
+    run_ok( 'prophet', [qw(publish --html --to), $alice_published] );
+};
+
+my $dir = dir($alice_published);
+
+my $merge_tickets = $dir->subdir('_merge_tickets');
+ok(!-e $merge_tickets, "_merge_tickets template directory absent");
+
+my $bug = $dir->subdir('Bug');
+ok(-e $bug, "Bug template directory exists");
+
+my $index = $bug->file('index.html');
+ok(-e $index, "Bug/index.html exists");
+
+my $bug_template = $bug->file("$bug_uuid.html");
+ok(-e $bug_template, "Bug/$bug_uuid.html exists");
+
+my $index_contents = $index->slurp;
+like($index_contents, qr/$bug_uuid/, "index contains bug uuid");
+like($index_contents, qr/this is a template test/, "index contains bug summary");
+
+my $bug_contents = $bug_template->slurp;
+like($bug_contents, qr/$bug_uuid/, "bug contains bug uuid");
+like($bug_contents, qr/this is a template test/, "bug contains bug summary");
+



More information about the Bps-public-commit mailing list