Skip to content

Instantly share code, notes, and snippets.

View brasmusson's full-sized avatar

Björn Rasmusson brasmusson

View GitHub Profile
@brasmusson
brasmusson / sequence.feature
Created December 28, 2014 19:53
Verifying call sequence of hooks and steps
Feature: Call sequence
Background:
Given first step
Scenario Outline:
Given second step
And third step
Examples:
@brasmusson
brasmusson / Console_Output.txt
Created December 18, 2014 18:55
JUnit Timeout Test exploration
A: 0
<snip>
A: 216
A-interrupted
A: 217
<snip>
A: 264
B: 0
<snip>
B: 199
@brasmusson
brasmusson / build.xml
Created February 22, 2014 17:15
Cucumber-JVM: example/java-helloworld Ant file for JUnit runner
<project name="java-helloworld" basedir="." default="runcukes">
<property name="repo" value="https://oss.sonatype.org/content/repositories/releases"/>
<!-- To figure out compatible combinations of versions, you should examine dependencies in the Maven POM files -->
<property name="cucumber-jvm.version" value="1.1.5"/>
<property name="cucumber-jvm-deps.version" value="1.0.3"/>
<property name="gherkin.version" value="2.12.1"/>
<property name="cucumber-html.version" value="0.2.3"/>
<property name="jchronic.version" value="0.2.6"/>
<property name="junit.version" value="4.11"/>
@brasmusson
brasmusson / Runtime.java
Last active December 18, 2015 08:39
Cucumber-JVM: Cutting back on Runtime constructors. It is possible to limit them to one constructor and one factory method, but is it the right way to go? 10 files will be affected (mostly test files) in the three projects core, java and junit. To simplify the creation of Runtime in test an additional factory method is introduced in RuntimeTest …
public class Runtime implements UnreportedStepExecutor {
// the factory method is used by cucumber.api.cli.Main and cucumber.api.junit.Cucumber
public static Runtime createRuntime(ResourceLoader resourceLoader, ClassLoader classLoader, RuntimeOptions runtimeOptions) {
UndefinedStepsTracker undefinedStepsTracker = new UndefinedStepsTracker();
return new Runtime(resourceLoader, classLoader, loadBackends(resourceLoader, classLoader), runtimeOptions,
undefinedStepsTracker, new RuntimeGlue(undefinedStepsTracker, new LocalizedXStreams(classLoader)));
}
// The constructor is used in tests both in the core and in the java projects, therefore it needs to be public