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.Arrays;
06: import java.util.List;
07:
08: import junit.framework.TestCase;
09: import fit.Fixture;
10: import fit.Parse;
11: import fitnesse.html.HtmlUtil;
12: import fitnesse.util.StringUtil;
13:
14: public class HandleFixtureDoesNotExtendFixtureTest extends TestCase {
15: public void testLearnHowBadFixtureClassIsHandled() throws Exception {
16: List tableLines = Arrays.asList(new String[] { "<table>",
17: " <tr>",
18: " <td>fitnesse.fixtures.WouldBeFixture</td>",
19: " </tr>", "</table>" });
20:
21: String tableText = StringUtil.join(tableLines, "\r\n");
22:
23: Parse tableForFaultyFixture = new Parse(tableText);
24:
25: new Fixture().doTables(tableForFaultyFixture);
26: String fixtureClassCellText = tableForFaultyFixture.at(0, 0, 0).body;
27:
28: assertEquals(
29: "fitnesse.fixtures.WouldBeFixture"
30: + HtmlUtil.HR
31: + " <span class=\"fit_label\">"
32: + "Class fitnesse.fixtures.WouldBeFixture is not a fixture."
33: + "</span>", fixtureClassCellText);
34: }
35:
36: }
|