Skip to content

Add detail to DataTable hint in JavaSnippet and update test #1298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 28, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public String arguments(List<Class<?>> argumentTypes) {
public String tableHint() {
return " // For automatic transformation, change DataTable to one of\n" +
" // List<YourType>, List<List<E>>, List<Map<K,V>> or Map<K,V>.\n" +
" // E,K,V must be a scalar (String, Integer, Date, enum etc)\n";
" // E,K,V must be a scalar (String, Integer, Date, enum etc)\n" +
" // Make sure the variable names for YourType match the column names\n" +
" // in your feature file.\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 'The field names of YourType must match the column names' is better.

Field names instead of variables. The latter exists only in a function. The former is part of a type.

And must instead of make sure because of the rfc.

Not sure about the subject and object. Swapping might be better (if only someone told me learning grammar would allow me to discuss the use of language :) ).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Hope this is better.

}

@Override
Expand Down
2 changes: 2 additions & 0 deletions java/src/test/java/cucumber/runtime/java/JavaSnippetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ public void generatesSnippetWithDataTable() {
" // For automatic transformation, change DataTable to one of\n" +
" // List<YourType>, List<List<E>>, List<Map<K,V>> or Map<K,V>.\n" +
" // E,K,V must be a scalar (String, Integer, Date, enum etc)\n" +
" // Make sure the variable names for YourType match the column names\n" +
" // in your feature file.\n" +
" throw new PendingException();\n" +
"}\n";
PickleTable dataTable = new PickleTable(asList(new PickleRow(asList(new PickleCell(null, "col1")))));
Expand Down