Class: SuperDiff::RSpec::MatcherTextBuilders::Match

Inherits:
Base
  • Object
show all
Defined in:
lib/super_diff/rspec/matcher_text_builders/match.rb

Instance Method Summary collapse

Methods inherited from Base

#call, #matcher_description

Constructor Details

#initialize(expected_captures:, **rest) ⇒ Match

Returns a new instance of Match.



5
6
7
8
# File 'lib/super_diff/rspec/matcher_text_builders/match.rb', line 5

def initialize(expected_captures:, **rest)
  super(**rest)
  @expected_captures = expected_captures
end

Instance Method Details

#add_extraObject



10
11
12
13
14
15
# File 'lib/super_diff/rspec/matcher_text_builders/match.rb', line 10

def add_extra
  if expected_captures
    template.add_text "with captures "
    template.add_text_in_color :blue, description_of(expected_captures)
  end
end