cucumber/cucumber-jvm — Issue #114: disallowed characters in generated javamethod names
Author: mariobs
Created: 2011-12-08 13:54:59+00:00
State: open

I ran into something which I dont know if it has already been noticed:

If I am defining a step in a feature-file with a character that is not allowed in java-methods like , or ' :

In example I have a Step in the featurefile called (my steps are written in german):

Angenommen es existiert ein Musikkatalog, der das Album The Fabulous Johnny Cash enthält

I am getting a generated method snippet that results in a java syntax error (because of the ',' character) and I have to manually adjust it by removing the character:

@Angenommen("^es existiert ein Musikkatalog, der das Album (.*) enthält$")
public void es_existiert_ein_Musikkatalog_,der_das_Album_X_enthält(String albumname) {
// code here...
}

This must be mainly a bigger concern if you write steps in german, because those characters get used there a lot in senteces. You can also insert a slashdot, which makes the it worse.