Sha256: 1261aa120a8e8559bdb1c58fc340eba1d11b8bc4c2408f3af5000f405a66e3b1

Contents?: true

Size: 479 Bytes

Versions: 1

Compression:

Stored size: 479 Bytes

Contents

require 'method_log/method_diff'

describe MethodLog::MethodDiff do
  let(:commit) { double(:commit) }
  let(:parent) { double(:parent) }
  let(:diff) { MethodLog::MethodDiff.new(commit: commit, parent: parent) }

  it 'generates text diff of the method source for two commits' do
    commit.stub(:method_source).and_return(%{line 1\nline 2\n})
    parent.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

1 entries across 1 versions & 1 rubygems

Version Path
method_log-0.0.3 spec/method_diff_spec.rb