Class: Operandi::RSpec::Matchers::SkipStepMatcher
- Inherits:
-
Object
- Object
- Operandi::RSpec::Matchers::SkipStepMatcher
- Defined in:
- lib/operandi/rspec/matchers/execute_step.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(name) ⇒ SkipStepMatcher
constructor
A new instance of SkipStepMatcher.
- #matches?(service) ⇒ Boolean
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
#description ⇒ Object
115 116 117 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 115 def description "skip step :#{@name}" end |
#failure_message ⇒ Object
104 105 106 107 108 109 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 104 def return unless service_tracks_steps? "expected service to skip step :#{@name}, but it was executed. " \ "Executed steps: #{executed_steps.inspect}" end |
#failure_message_when_negated ⇒ Object
111 112 113 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 111 def "expected service not to skip step :#{@name} (expected it to execute)" end |
#matches?(service) ⇒ 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 |