Class: Operandi::RSpec::Matchers::ExecuteStepsMatcher
- Inherits:
-
Object
- Object
- Operandi::RSpec::Matchers::ExecuteStepsMatcher
- Defined in:
- lib/operandi/rspec/matchers/execute_step.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(names, ordered:) ⇒ ExecuteStepsMatcher
constructor
A new instance of ExecuteStepsMatcher.
- #matches?(service) ⇒ Boolean
Constructor Details
#initialize(names, ordered:) ⇒ ExecuteStepsMatcher
Returns a new instance of ExecuteStepsMatcher.
140 141 142 143 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 140 def initialize(names, ordered:) @names = names @ordered = ordered end |
Instance Method Details
#description ⇒ Object
172 173 174 175 176 177 178 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 172 def description if @ordered "execute steps #{@names.inspect} in order" else "execute steps #{@names.inspect}" end end |
#failure_message ⇒ Object
156 157 158 159 160 161 162 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 156 def return unless service_tracks_steps? return unless all_steps_executed? return unless order_matches? "" end |
#failure_message_when_negated ⇒ Object
164 165 166 167 168 169 170 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 164 def if @ordered "expected service not to execute steps #{@names.inspect} in that order" else "expected service not to execute steps #{@names.inspect}" end end |
#matches?(service) ⇒ Boolean
145 146 147 148 149 150 151 152 153 154 |
# File 'lib/operandi/rspec/matchers/execute_step.rb', line 145 def matches?(service) @service = service @missing_steps = [] return false unless service_tracks_steps? return false unless all_steps_executed? return false unless order_matches? true end |