Skip to content

Commit 2cf0da0

Browse files
committed
Upgraded to work with sbt 0.12.0 and Scala 2.9.2
1 parent dce0128 commit 2cf0da0

File tree

16 files changed

+85
-17
lines changed

16 files changed

+85
-17
lines changed

README.markdown

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
xsbt-cucumber-plugin
22
====================
33

4-
An [sbt 0.11.x](https://github.com/harrah/xsbt/wiki) plugin for running [Cucumber](http://cukes.info) features.
4+
An [sbt 0.12.x](https://github.com/harrah/xsbt/wiki) plugin for running [Cucumber](http://cukes.info) features.
55

6-
IMPORTANT: The current release is a major update that switches from running the ruby version of cucumber (using JRuby) to running cucumber-jvm. This provides a significant improvement in speed and reliability. It also significantly changes the configuration options for the plugin. If you are using an older version of this plugin, please read below and update your project configurations to match the new options.
6+
IMPORTANT: Release 0.5.0 onwards are a major update that switches from running the ruby version of cucumber (using JRuby) to running cucumber-jvm. This provides a significant improvement in speed and reliability. It also significantly changes the configuration options for the plugin. If you are using a version of this plugin before 0.5.0, please read below and update your project configurations to match the new options.
77

88
Provides the ability to run Cucumber-jvm within the SBT environment. Originally based on the [cuke4duke-sbt-plugin](https://github.com/rubbish/cuke4duke-sbt-plugin) by rubbish and my original implementation for SBT 0.7.x. Specifics for this release:
99

10-
* Works with xsbt 0.11.3 (probably works with other 0.11.x versions, but I haven't tested this)
11-
* Works with cucumber-jvm (1.0.9 for scala 2.9 and 1.0.10 for scala 2.10)
12-
* Allows projects compiled and running against Scala 2.9.1, 2.9.2 and 2.10.0-M4
10+
* Works with xsbt 0.12.0
11+
* Works with cucumber-jvm (version 1.0.9 for Scala 2.9.x and version 1.0.14 for Scala 2.10.0-M6)
12+
* Allows projects compiled and running against Scala 2.9.1, 2.9.2 and 2.10.0-M6
13+
* NOTE: Currently doesn't work with Scala 2.10.0-M7 as this isn't supported by the latest cucumber-jvm version
1314

1415
## Usage ##
1516
Install the plugin (see later). By default features files go in a 'src/test/features' directory. Step definitions go in 'src/test/scala'. Finally from the sbt console call the task:
@@ -76,7 +77,7 @@ To install the cucumber plugin, add entries to the build plugins file (project/p
7677

7778
resolvers += "Templemore Repository" at "http://templemore.co.uk/repo"
7879

79-
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.5.0")
80+
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.0")
8081

8182
### Basic Configuration ###
8283
To add the cucumber plugin settings to a basic project, just add the following to the build.sbt file:
@@ -140,6 +141,9 @@ Requests for features can be posted to the issues list or emailed to the author.
140141

141142
## Release History ##
142143

144+
### 0.6.0 ###
145+
Updated to work the SBT 0.12.0, Scala 2.9.2 and the latest Cucumber-jvm 1.0.14 versions.
146+
143147
### 0.5.0 ###
144148
Moved from ruby implementation of Cucumber to Cucumber-jvm. This changes many of the plugin settings and options. In particular, output options are significantly improved.
145149

build.sbt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name := "xsbt-cucumber-plugin"
22

3-
version := "0.5.0"
3+
version := "0.6.0"
44

55
organization := "templemore"
66

7-
scalaVersion := "2.9.1"
7+
scalaVersion := "2.9.2"
88

99
sbtPlugin := true
1010

1111
resolvers += "sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
1212

13-
publishTo := Some(Resolver.file("Local Repo", file((Path.userHome / ".m2" / "repository").toString)))
13+
publishTo := Some(Resolver.file("publishTo", file((Path.userHome / ".m2" / "repository").toString)))
1414

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.11.3
1+
sbt.version=0.12.0

src/main/scala/templemore/xsbt/cucumber/CucumberPlugin.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Project.Initialize
1010
object CucumberPlugin extends Plugin with CucumberIntegration {
1111

1212
private val CucumberVersionForScala2_9 = "1.0.9"
13-
private val CucumberVersionForScala2_10 = "1.0.10"
13+
private val CucumberVersionForScala2_10 = "1.0.14"
1414

1515
type LifecycleCallback = () => Unit
1616

testProjects/multiModuleTestProject/project/Build.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import templemore.xsbt.cucumber.CucumberPlugin
55
object BuildSettings {
66
val buildOrganization = "templemore"
77
val buildScalaVersion = "2.9.2"
8-
val buildVersion = "0.5.0"
8+
val buildVersion = "0.6.0"
99

1010
val buildSettings = Defaults.defaultSettings ++
1111
Seq (organization := buildOrganization,
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
sbt.version=0.11.3
1+
sbt.version=0.12.0
22

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
resolvers += Resolver.file("Local Repo", file((Path.userHome / ".m2" / "repository").toString))
22

3-
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.5.0")
3+
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.0")

testProjects/testProject/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "test-project"
22

3-
version := "0.5.0"
3+
version := "0.6.0"
44

55
organization := "templemore"
66

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.11.3
1+
sbt.version=0.12.0
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
resolvers += Resolver.file("Local Repo", file((Path.userHome / ".m2" / "repository").toString))
22

3-
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.5.0")
3+
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.0")
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
target
3+
project/boot
4+
project/target
5+
project/plugins/target
6+
project/plugins/project
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name := "test-project"
2+
3+
version := "0.6.0"
4+
5+
organization := "templemore"
6+
7+
scalaVersion := "2.10.0-M6"
8+
9+
libraryDependencies ++= Seq(
10+
"org.scalatest" % "scalatest_2.10.0-M6" % "1.9-2.10.0-M6-B2" % "test"
11+
)
12+
13+
seq(cucumberSettings : _*)
14+
15+
cucumberStepsBasePackage := "test"
16+
17+
cucumberHtmlReport := true
18+
19+
cucumberJunitReport := true
20+
21+
cucumberJsonReport := true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=0.12.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolvers += Resolver.file("Local Repo", file((Path.userHome / ".m2" / "repository").toString))
2+
3+
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.0")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@example-jar
2+
Feature: Cucumber in Jar Project
3+
In order to implement BDD in my Scala project
4+
As a developer
5+
I want to be able to run Cucumber from with SBT
6+
7+
Scenario: Execute feature in a Jar Project
8+
Given an SBT project
9+
When the cucumber task is called
10+
Then Cucumber is executed against the features and step definitions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package test
2+
3+
import cucumber.runtime.{EN, ScalaDsl}
4+
import org.scalatest.matchers.ShouldMatchers
5+
6+
class CucumberJarStepDefinitions extends ScalaDsl with EN with ShouldMatchers {
7+
8+
private var givenCalled = false
9+
private var whenCalled = false
10+
11+
Given("""^an SBT project$""") { () =>
12+
givenCalled = true
13+
}
14+
15+
When("""^the cucumber task is called$""") { () =>
16+
whenCalled = true
17+
}
18+
19+
Then("""^Cucumber is executed against the features and step definitions$""") { () =>
20+
givenCalled should be (true)
21+
whenCalled should be (true)
22+
}
23+
}

0 commit comments

Comments
 (0)