Class: Operandi::RSpec::Matchers::SkipStepMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/operandi/rspec/matchers/execute_step.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ SkipStepMatcher

Returns a new instance of SkipStepMatcher.



91
92
93
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 91

def initialize(name)
  @name = name
end

Instance Method Details

#descriptionObject



115
116
117
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 115

def description
  "skip step :#{@name}"
end

#failure_messageObject



104
105
106
107
108
109
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 104

def failure_message
  return tracking_not_available_message unless service_tracks_steps?

  "expected service to skip step :#{@name}, but it was executed. " \
    "Executed steps: #{executed_steps.inspect}"
end

#failure_message_when_negatedObject



111
112
113
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 111

def failure_message_when_negated
  "expected service not to skip step :#{@name} (expected it to execute)"
end

#matches?(service) ⇒ Boolean

Returns:

  • (Boolean)


95
96
97
98
99
100
101
102
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 95

def matches?(service)
  @service = service

  return false unless service_tracks_steps?
  return false unless step_skipped?

  true
end