Search in sources :

Example 6 with DocString

use of gherkin.formatter.model.DocString in project cucumber-jvm by cucumber.

the class GosuSnippetTest method generatesSnippetWithDocString.

@Test
public void generatesSnippetWithDocString() {
    String expected = "" + "Dsl.Given('^I have:$', \\ arg1 : String  -> {\n" + "    // Write code here that turns the phrase above into concrete actions\n" + "    throw new PendingException()\n" + "})\n";
    assertEquals(expected, snippetForDocString("I have:", new DocString("text/plain", "hello", 1)));
}
Also used : DocString(gherkin.formatter.model.DocString) DocString(gherkin.formatter.model.DocString) Test(org.junit.Test)

Example 7 with DocString

use of gherkin.formatter.model.DocString in project cucumber-jvm by cucumber.

the class GroovySnippetTest method generatesSnippetWithDocString.

@Test
public void generatesSnippetWithDocString() {
    String expected = "" + "Given(~/^I have:$/) { String arg1 ->\n" + "    // Write code here that turns the phrase above into concrete actions\n" + "    throw new PendingException()\n" + "}\n";
    assertEquals(expected, snippetForDocString("I have:", new DocString("text/plain", "hello", 1)));
}
Also used : DocString(gherkin.formatter.model.DocString) DocString(gherkin.formatter.model.DocString) Test(org.junit.Test)

Example 8 with DocString

use of gherkin.formatter.model.DocString in project cucumber-jvm by cucumber.

the class CucumberScenarioOutlineTest method allows_doc_strings_to_be_empty_after_replacement.

@Test
public void allows_doc_strings_to_be_empty_after_replacement() {
    Step outlineStep = new Step(C, null, "Some step", 0, null, new DocString(null, "<doc string>", 1));
    Step exampleStep = CucumberScenarioOutline.createExampleStep(outlineStep, new ExamplesTableRow(C, asList("doc string"), 1, ""), new ExamplesTableRow(C, asList(""), 1, ""));
    assertEquals("", exampleStep.getDocString().getValue());
}
Also used : ExamplesTableRow(gherkin.formatter.model.ExamplesTableRow) DocString(gherkin.formatter.model.DocString) Step(gherkin.formatter.model.Step) Test(org.junit.Test)

Aggregations

DocString (gherkin.formatter.model.DocString)8 Test (org.junit.Test)8 Step (gherkin.formatter.model.Step)5 LocalizedXStreams (cucumber.runtime.xstream.LocalizedXStreams)3 Argument (gherkin.formatter.Argument)3 ExamplesTableRow (gherkin.formatter.model.ExamplesTableRow)2