Need to:
- give some hints in
tests/README
- warn tests dependency on
TWiki::Plugins::TestFixturePlugin::HTMLDiffer
in tests/unit/TWikiTestCase.pm
CC, please check if the following changes would be enough:
=== unit/TWikiTestCase.pm
==================================================================
--- unit/TWikiTestCase.pm (revision 9130)
+++ unit/TWikiTestCase.pm (local)
@@ -9,9 +9,11 @@
# you can always create a new web based on that web.
#
use base qw(Test::Unit::TestCase);
+use vars qw( $has_TestFixturePlugin );
use TWiki;
-use TWiki::Plugins::TestFixturePlugin::HTMLDiffer;
+eval "use TWiki::Plugins::TestFixturePlugin::HTMLDiffer";
+$has_TestFixturePlugin = 1 unless $@;
use strict;
use Error qw( :try );
@@ -114,6 +116,9 @@
# tags which will _not_ be detected.
sub assert_html_equals {
my( $this, $e, $a, $mess ) = @_;
+
+ $this->assert(0, "Failed loading TWiki::Plugins::TestFixturePlugin::HTMLDiffer, TestFixturePlugin's lib directory should be in \@INC.") unless $has_TestFixturePlugin;
+
my ($package, $filename, $line) = caller(0);
my $opts =
{
@@ -135,6 +140,9 @@
# block of HTML. Not too clever about tag attributes.
sub assert_html_matches {
my ($this, $e, $a, $mess ) = @_;
+
+ $this->assert(0, "Failed loading TWiki::Plugins::TestFixturePlugin::HTMLDiffer, TestFixturePlugin's lib directory should be in \@INC.") unless $has_TestFixturePlugin;
+
$mess ||= "$a\ndoes not match\n$e";
my ($package, $filename, $line) = caller(0);
unless( TWiki::Plugins::TestFixturePlugin::HTMLDiffer::html_matches($e, $a)) {
--
AT
That should be fine. Thanks!
CC
Changed to an enhancement.
this was applied on SVN:6383, so i'm closing it. --
WN