All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cucumber.runtime.scala.ScalaHookDefinition.scala Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package cucumber.runtime.scala

import _root_.gherkin.TagExpression
import _root_.gherkin.formatter.model.Tag
import _root_.java.util.Collection
import _root_.cucumber.api.Scenario
import _root_.cucumber.runtime.HookDefinition
import collection.JavaConverters._

class ScalaHookDefinition(f:Scenario => Unit,
                          order:Int,
                          tags:Seq[String]) extends HookDefinition {

  val tagExpression = new TagExpression(tags.asJava)

  def getLocation(detail: Boolean) = "TODO: Implement getLocation in similar fashion to ScalaStepDefinition"

  def execute(scenario: Scenario) { f(scenario) }

  def matches(tags: Collection[Tag]) = tagExpression.evaluate(tags)

  def getOrder = order

  def isScenarioScoped = false
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy