Sha256: 726576d77fc2c10caab654c06e4b4357c022a6e7c0ecdf6c38d35f2acf059c2b

Contents?: true

Size: 827 Bytes

Versions: 7

Compression:

Stored size: 827 Bytes

Contents

require File.dirname(__FILE__) + '/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.8 test/test_diff.rb
mercurial-ruby-0.7.7 test/test_diff.rb
mercurial-ruby-0.7.6 test/test_diff.rb
mercurial-ruby-0.7.5 test/test_diff.rb
mercurial-ruby-0.7.4 test/test_diff.rb
mercurial-ruby-0.7.3 test/test_diff.rb
mercurial-ruby-0.7.2 test/test_diff.rb