Skip to content

Commit

Permalink
Array formatting example #351
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schäfer committed Jul 28, 2018
1 parent fe0975f commit 099002e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,17 @@ public GivenTestStep ALLUPPERCASE() {
return self();
}

public GivenTestStep arrays_as_parameters(String[] params) {
return self();
}

@As( "another description" )
@IntroWord
public GivenTestStep an_intro_word_with_an_as_annotation() {
return self();
}


public static class CustomAsProvider implements AsProvider {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,16 @@ public void varargs_formatting() throws UnsupportedEncodingException {
assertThat( string ).contains( "Given varargs as parameters a, b, c" );
}

@Test
public void array_formatting() throws UnsupportedEncodingException {
getScenario().startScenario( "varargs" );

given().arrays_as_parameters( new String[] {"a", "b", "c" } );

String string = PlainTextReporter.toString( getScenario().getScenarioModel() );
assertThat( string ).contains( "Given arrays as parameters a, b, c" );
}

@Test
public void pojo_format_is_working() throws Throwable {
getScenario().startScenario( "test" );
Expand Down

0 comments on commit 099002e

Please sign in to comment.