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: 7.1.0
Show newest version
package cucumber.runtime.scala

import gherkin.pickles.PickleTag
import java.util.Collection

import cucumber.api.Scenario
import cucumber.runtime.HookDefinition
import cucumber.runtime.filter.TagPredicate

import scala.collection.JavaConverters._

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

  val tagPredicate = new TagPredicate(tags.asJava)

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

  def execute(scenario: Scenario): Unit = f(scenario) 

  def matches(tags: Collection[PickleTag]) = tagPredicate.apply(tags)

  def getOrder = order

  def isScenarioScoped = false
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy