Class: NoInspectMatch
- Inherits:
-
Object
- Object
- NoInspectMatch
- Defined in:
- lib/cuken/cucumber/chef/run_client_steps.rb
Overview
Matcher for regular expression which uses normal string interpolation for the actual (target) value instead of expecting it, as stdout/stderr which get matched against may have lots of newlines, which looks ugly when inspected, as the newlines show up as n
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected_regex) ⇒ NoInspectMatch
constructor
A new instance of NoInspectMatch.
- #matches?(target) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected_regex) ⇒ NoInspectMatch
Returns a new instance of NoInspectMatch.
214 215 216 |
# File 'lib/cuken/cucumber/chef/run_client_steps.rb', line 214 def initialize(expected_regex) @expected_regex = expected_regex end |
Instance Method Details
#failure_message ⇒ Object
221 222 223 |
# File 'lib/cuken/cucumber/chef/run_client_steps.rb', line 221 def "expected #{@target} should match #{@expected_regex}" end |
#matches?(target) ⇒ Boolean
217 218 219 220 |
# File 'lib/cuken/cucumber/chef/run_client_steps.rb', line 217 def matches?(target) @target = target @target =~ @expected_regex end |
#negative_failure_message ⇒ Object
224 225 226 |
# File 'lib/cuken/cucumber/chef/run_client_steps.rb', line 224 def "expected #{@target} not to match #{@expected_regex}" end |