Class: RSpec::Support::HunkGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/support/hunk_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(actual, expected) ⇒ HunkGenerator

Returns a new instance of HunkGenerator.



8
9
10
11
# File 'lib/rspec/support/hunk_generator.rb', line 8

def initialize(actual, expected)
  @actual = actual
  @expected = expected
end

Instance Method Details

#hunksObject



13
14
15
16
17
18
# File 'lib/rspec/support/hunk_generator.rb', line 13

def hunks
  @file_length_difference = 0
  @hunks ||= diffs.map do |piece|
    build_hunk(piece)
  end
end