Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 24 lines (18 sloc) 0.58 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package cucumber.examples.scalacalculator

import cucumber.api.Scenario
import cucumber.api.scala.{ScalaDsl, EN}
import org.junit.Assert._

class RpnCalculatorStepDefinitions extends ScalaDsl with EN {

  val calc = new RpnCalculator

  When("""^I add (\d+) and (\d+)$"""){ (arg1: Double, arg2: Double) =>
    calc push arg1
    calc push arg2
    calc push "+"
  }

  Then("^the result is (\\d+)$") { expected: Double =>
    assertEquals(expected, calc.value, 0.001)
  }

  Before("~@foo"){ scenario : Scenario =>
    println("Runs before scenarios *not* tagged with @foo")
  }
}
Something went wrong with that request. Please try again.