Class: IntervalSkipListSpecHelper::HaveMarkers
- Defined in:
- lib/vendor/treetop/spec/runtime/interval_skip_list/spec_helper.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected_markers) ⇒ HaveMarkers
constructor
A new instance of HaveMarkers.
- #matches?(target) ⇒ Boolean
Constructor Details
#initialize(expected_markers) ⇒ HaveMarkers
Returns a new instance of HaveMarkers.
65 66 67 |
# File 'lib/vendor/treetop/spec/runtime/interval_skip_list/spec_helper.rb', line 65 def initialize(expected_markers) @expected_markers = expected_markers end |
Instance Method Details
#failure_message ⇒ Object
78 79 80 |
# File 'lib/vendor/treetop/spec/runtime/interval_skip_list/spec_helper.rb', line 78 def "Expected #{@target.inspect} to include only #{@expected_markers.inspect}" end |
#matches?(target) ⇒ Boolean
69 70 71 72 73 74 75 76 |
# File 'lib/vendor/treetop/spec/runtime/interval_skip_list/spec_helper.rb', line 69 def matches?(target) @target = target return false unless @target.size == @expected_markers.size @expected_markers.each do |expected_marker| return false unless @target.include?(expected_marker) end true end |