Class: Operandi::RSpec::Matchers::ExecuteStepMatcher
- Inherits:
-
Object
- Object
- Operandi::RSpec::Matchers::ExecuteStepMatcher
- 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) ⇒ ExecuteStepMatcher
constructor
A new instance of ExecuteStepMatcher.
- #matches?(service) ⇒ Boolean
Constructor Details
#initialize(name) ⇒ ExecuteStepMatcher
Returns a new instance of ExecuteStepMatcher.
42 43 44 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 42 def initialize(name) @name = name end |
Instance Method Details
#description ⇒ Object
66 67 68 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 66 def description "execute step :#{@name}" end |
#failure_message ⇒ Object
55 56 57 58 59 60 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 55 def return unless service_tracks_steps? "expected service to execute step :#{@name}, " \ "but executed steps were: #{executed_steps.inspect}" end |
#failure_message_when_negated ⇒ Object
62 63 64 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 62 def "expected service not to execute step :#{@name}" end |
#matches?(service) ⇒ Boolean
46 47 48 49 50 51 52 53 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 46 def matches?(service) @service = service return false unless service_tracks_steps? return false unless step_executed? true end |