Class: CukeTest::CucumberMatchers::FailCuke

Inherits:
Object
  • Object
show all
Defined in:
lib/cuke-test/cucumber_matchers.rb

Instance Method Summary collapse

Constructor Details

#initialize(step = nil) ⇒ FailCuke

Returns a new instance of FailCuke.



29
30
31
# File 'lib/cuke-test/cucumber_matchers.rb', line 29

def initialize(step = nil)
	@step = step
end

Instance Method Details

#failure_messageObject



39
40
41
# File 'lib/cuke-test/cucumber_matchers.rb', line 39

def failure_message
	message('to fail')
end

#matches?(target) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
37
# File 'lib/cuke-test/cucumber_matchers.rb', line 33

def matches?(target)
	@target = target
	target.match(/[0-9]+ scenarios? \([0-9]+ failed(, [0-9]+ passed)?\)/) and
		(@step.nil? or target.match(/in `#{@step}'/))
end

#negative_failure_messageObject



43
44
45
# File 'lib/cuke-test/cucumber_matchers.rb', line 43

def negative_failure_message
	message('not to fail')
end