Skip to content

Commit

Permalink
Merge. Closes #708
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Aug 29, 2014
2 parents 1ed7dab + a53cde8 commit 7acdd00
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package cucumber.runtime.java.spring.contextconfig;

import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.runtime.java.spring.beans.Belly;
import cucumber.runtime.java.spring.beans.BellyBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

@ContextConfiguration("classpath:cucumber.xml")
public class BellyStepdefs {
Expand All @@ -18,29 +17,17 @@ public class BellyStepdefs {
@Autowired
private BellyBean bellyBean;

@Then("^there are (\\d+) cukes in my belly")
public void checkCukes(final int n) {
assertEquals(n, belly.getCukes());
belly.setCukes(0);
}

@Given("^I have (\\d+) cukes in my belly")
public void haveCukes(final int n) {
belly.setCukes(n);
}

@Given("^I have (\\d+) beans in my belly$")
public void I_have_beans_in_my_belly(int n) {
bellyBean.setCukes(n);
public BellyBean getBellyBean() {
return bellyBean;
}

@Then("^there are (\\d+) beans in my belly$")
public void there_are_beans_in_my_belly(int n) {
assertEquals(n, bellyBean.getCukes());
@Then("^I have belly$")
public void I_have_belly() throws Throwable {
assertNotNull(belly);
}

public BellyBean getBellyBean() {
return bellyBean;
@Then("^I have belly bean$")
public void I_have_belly_bean() throws Throwable {
assertNotNull(bellyBean);
}

}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Feature: Spring Dirty Cukes
I want each dirty scenario to have its own application context

Scenario Outline: Eat some annotated dirty cukes
Given I have <numberOfBeans> dirty cukes in my belly
Given there are 0 dirty cukes in my belly
When I have <numberOfBeans> dirty cukes in my belly
Then there are <numberOfBeans> dirty cukes in my belly

Examples:
Expand All @@ -13,7 +14,8 @@ Feature: Spring Dirty Cukes
| 2 |

Scenario Outline: Eat some XML dirty beans
Given I have <numberOfBeans> dirty beans in my belly
Given there are 0 dirty beans in my belly
When I have <numberOfBeans> dirty beans in my belly
Then there are <numberOfBeans> dirty beans in my belly

Examples:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: Cukes injection

Scenario: annotated bean injected
Then I have belly

Scenario: xml bean injected
Then I have belly bean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: Spring injection with annotations
Feature: Spring web contextrenam injection with annotations

Scenario: Inject web context
Given I have the web context set
Expand Down

This file was deleted.

0 comments on commit 7acdd00

Please sign in to comment.