jnicklas/turnip — pull request #63 by hngreenwood (2012-07-13 07:18:13+00:00)
Title: JRuby bugfix: Java Gherkin throwing NullPointerException: uri

Hi, thank you for making Turnip.

I'm using JRuby. When running a .feature, [this exception is thrown](https://gist.github.com/3103026):
```
Parser.java:181:in `': java.lang.NullPointerException: uri
from Parser.java:66:in `pushMachine'
from Parser.java:56:in `parse'
...
```

That's Gherkin complaining. It turns out with JRuby a native Java Gherkin is used and it's picky about how it's parse method is called: when featureURI is null, the above exception results. [Excerpts from Parser.java](https://github.com/cucumber/gherkin/blob/master/java/src/main/java/gherkin/parser/Parser.java
):
```java
/**
* @param featureURI the URI where the gherkin originated from. Typically a file path.
* @param lineOffset the line offset within the uri document the gherkin was taken from. Typically 0.
*/
public void parse(String gherkin, String featureURI, Integer lineOffset) {
```
```java
public Machine(Parser parser, String name, String uri) {
if (uri == null) {
throw new NullPointerException("uri");
```

By passing feature_file as the featureURI, Java Gherkin is happy!