This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloWorldSpec extends Specification { | |
"The 'Hello world' string" should { | |
"contain 11 characters" should { | |
"Hello world" must have size(11) | |
} | |
"start with 'Hello'" should { | |
"Hello world" must startWith("Hello") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloWorldSpec extends Specification { def is = s2""" | |
This is a specification to check the 'Hello world' string | |
The 'Hello world' string should | |
contain 11 characters $e1 | |
start with 'Hello' $e2 | |
end with 'world' $e3 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Chicken Collecting Insects Calculator | |
Scenario Outline: | |
Given a chicken collects <insectsPerMinute> insects per minute | |
When chicken has searched insects for <minutes> minutes | |
Then the chicken has found <foundInsects> insects | |
Examples: | |
| insectsPerMinute | minutes | foundInsects | | |
| 3 | 5 | 15 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Chicken Collecting Insects Calculator | |
@wip | |
Scenario: Chicken collects insects for several minutes | |
Given a chicken collects 3 insects per minute | |
When chicken has searched insects for 5 minutes | |
Then the chicken has found 15 insects | |
Scenario: Chicken collects insects for several hours | |
Given a chicken collects 2 insects per minute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package steps | |
import io.cucumber.scala.{LT, ScalaDsl} | |
class StepDefinitions extends ScalaDsl with LT { | |
Duota("""a chicken collects {int} insects per minute""") { (int1: Int) => | |
// Write code here that turns the phrase above into concrete actions | |
throw new io.cucumber.scala.PendingException() | |
} | |
Kai("""chicken has searched insects for {int} minutes""") { (int1: Int) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package steps | |
import io.cucumber.scala.{EN, ScalaDsl} | |
class StepDefinitions extends ScalaDsl with EN { | |
val chickenCalculator: Option[ChickenCalculator] = None | |
val actualInsectCount: Option[Int] = None | |
Given("""a chicken collects {int} insects per minute""") { (insectsPerMinute: Int) => | |
chickenCalculator = Some(new ChickenCalculator(insectsPerMinute)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package steps | |
import io.cucumber.scala.{EN, ScalaDsl} | |
class StepDefinitions extends ScalaDsl with EN { | |
Given("""a chicken collects {int} insects per minute""") { (int1: Int) => | |
// Write code here that turns the phrase above into concrete actions | |
throw new io.cucumber.scala.PendingException() | |
} | |
When("""chicken has searched insects for {int} minutes""") { (int1: Int) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Chicken Collecting Insects Calculator | |
Scenario: Chicken collects insects for several minutes | |
Given a chicken collects 3 insects per minute | |
When chicken has searched insects for 5 minutes | |
Then the chicken has found 15 insects | |
Scenario: Chicken collects insects for several hours | |
Given a chicken collects 2 insects per minute | |
When chicken has searched insects for 2 hours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Chicken Finds Insects | |
Scenario Outline: | |
Given there is a <type> chicken | |
When chicken has searched insects for <minutes> minutes | |
Then the chicken has found <insectCount> insects | |
Examples: | |
| type | minutes | insectCount | | |
| regular | 1 | 3 | | |
| regular | 10 | 30 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Answerer that knows everything about chickens | |
Scenario Outline: | |
Given there is a answerer | |
And there is a user | |
When user ask the answerer <question> | |
Then the answerer replies <answer> | |
Examples: | |
| question | answer | | |
| "Why did the robot chicken cross the road?" | "Because it was programmed to"| |
NewerOlder