01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.fixtures;
04:
05: import java.util.*;
06:
07: import junit.framework.TestCase;
08: import fit.*;
09: import fitnesse.util.StringUtil;
10:
11: public class HandleFixtureDoesNotExtendFixtureTest extends TestCase {
12: public void testLearnHowBadFixtureClassIsHandled() throws Exception {
13: List tableLines = Arrays.asList(new String[] { "<table>",
14: " <tr>",
15: " <td>fitnesse.fixtures.WouldBeFixture</td>",
16: " </tr>", "</table>" });
17:
18: String tableText = StringUtil.join(tableLines, "\r\n");
19:
20: Parse tableForFaultyFixture = new Parse(tableText);
21:
22: new Fixture().doTables(tableForFaultyFixture);
23: String fixtureClassCellText = tableForFaultyFixture.at(0, 0, 0).body;
24:
25: assertEquals(
26: "fitnesse.fixtures.WouldBeFixture<hr/> "
27: + "<span class=\"fit_label\">"
28: + "Class fitnesse.fixtures.WouldBeFixture is not a fixture."
29: + "</span>", fixtureClassCellText);
30: }
31:
32: }
|