• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

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

ItemTemplate
Summary unit tests should be more intuitive to use
ReportedBy AntonioTerceiro
Codebase

AppliesTo Engine
Priority Enhancement
CurrentState Closed
WaitingFor

Checkins 6383
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r7 - 2005-10-02 - WillNorris
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback