Sha256: b6dc2cab692126e94061c57bf95e175672fa14c12b3defaebb939d2e2323dddf

Contents?: true

Size: 544 Bytes

Versions: 2

Compression:

Stored size: 544 Bytes

Contents

require 'method_log/method_diff'

describe MethodLog::MethodDiff do
  let(:first_commit) { double(:first_commit) }
  let(:second_commit) { double(:second_commit) }
  let(:diff) { MethodLog::MethodDiff.new(first_commit: first_commit, second_commit: second_commit) }

  it 'generates text diff of the method source for two commits' do
    first_commit.stub(:method_source).and_return(%{line 1\nline 2\n})
    second_commit.stub(:method_source).and_return(%{line 2\nline 3\n})
    expect(diff.to_s).to eq(%{-line 1\n line 2\n+line 3\n})
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
method_log-0.0.5 spec/method_diff_spec.rb
method_log-0.0.4 spec/method_diff_spec.rb