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.wikitext.widgets;
04:
05: import fitnesse.wikitext.WikiWidget;
06:
07: public class FixtureWidgetTest extends AbstractWidget {
08: public void testFixtureWidgetRendersProperly() throws Exception {
09: assertWidgetRendersToContain("!fixture some.FixtureName",
10: "fixture: some.FixtureName");
11: }
12:
13: private void assertWidgetRendersToContain(final String text,
14: final String substring) throws Exception {
15: WikiWidget widget = makeWidget(text);
16: String html = widget.render();
17: assertSubString(substring, html);
18: }
19:
20: private FixtureWidget makeWidget(final String text)
21: throws Exception {
22: return new FixtureWidget(new MockWidgetRoot(), text);
23: }
24:
25: public void testAsWikiText() throws Exception {
26: final String FIXTURE_WIDGET = "!fixture myFixture";
27: FixtureWidget w = new FixtureWidget(new MockWidgetRoot(),
28: FIXTURE_WIDGET);
29: assertEquals(FIXTURE_WIDGET, w.asWikiText());
30: }
31:
32: protected String getRegexp() {
33: return FixtureWidget.REGEXP;
34: }
35: }
|