Sha256: a636bcd8300e2a710329384f4830b27056df059fb232033ea1102ca071d1097c

Contents?: true

Size: 801 Bytes

Versions: 7

Compression:

Stored size: 801 Bytes

Contents

require 'helper'

describe Mercurial::Diff do
  
  before do
    @repository = Mercurial::Repository.open(Fixtures.test_repo)
    @commit = @repository.commits.by_hash_id('34f85a44acf1')
    @diff = @commit.diffs.first
  end
  
  it "should have hash_a and hash_b" do
    @diff.hash_a.must_equal '25bb5c51fd61'
    @diff.hash_b.must_equal '34f85a44acf1'
  end
  
  it "should have file_a and file_b" do
    @diff.file_a.must_equal 'Rakefile'
    @diff.file_b.must_equal 'Rakefile'
  end

  it "should have body" do
    @diff.body.strip.must_equal expected_diff.strip
  end
  
private

  def expected_diff
    %q[--- a/Rakefile	Thu Jul 28 00:09:22 2011 +0800
+++ b/Rakefile	Thu Jul 28 02:03:13 2011 +0800
@@ -1,5 +1,7 @@
 # encoding: utf-8
 
+test
+
 require 'rubygems'
 require 'bundler']
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mercurial-ruby-0.7.1 test/test_diff.rb
mercurial-ruby-0.7.0 test/test_diff.rb
mercurial-ruby-0.6.1 test/test_diff.rb
mercurial-ruby-0.6.0 test/test_diff.rb
mercurial-ruby-0.5.0 test/test_diff.rb
mercurial-ruby-0.4.0 test/test_diff.rb
mercurial-ruby-0.3.0 test/test_diff.rb