Sha256: 5aa47f7985d2addbbe20b6db3df8070ff3c0f416190d6a56d27f5c558c254a7b

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

require "test/unit"
require File.expand_path(File.join(File.dirname(__FILE__), "../../lib/amp"))

class TestMerge < Test::Unit::TestCase
  TEST_BASE = File.expand_path(File.join(File.dirname(__FILE__), 'base.txt'))
  TEST_LOCAL = File.expand_path(File.join(File.dirname(__FILE__), 'local.txt'))
  TEST_REMOTE = File.expand_path(File.join(File.dirname(__FILE__), 'remote.txt'))
  TEST_EXPECTED = File.expand_path(File.join(File.dirname(__FILE__), 'expected.local.txt'))
  TEST_OUT = File.expand_path(File.join(File.dirname(__FILE__), 'local.txt.out'))
  TEST_BACKUP = File.expand_path(File.join(File.dirname(__FILE__), 'local.txt.bak'))
  
  def test_full_merge
    File.copy TEST_LOCAL, TEST_BACKUP
    
    # kill the error output...
    old, $stderr = $stderr, StringIO.new
    Amp::Merges::ThreeWayMerger.three_way_merge(TEST_LOCAL, TEST_BASE, TEST_REMOTE,
                                                :labels => ["local","other"])
    $stderr = old # and reassign
    
    File.move TEST_LOCAL , TEST_OUT
    File.move TEST_BACKUP, TEST_LOCAL
    assert_equal File.read(TEST_EXPECTED), File.read(TEST_OUT)
  end
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
amp-0.5.2 test/merge_tests/test_merge.rb
amp-0.5.1 test/merge_tests/test_merge.rb
amp-pure-0.5.0 test/merge_tests/test_merge.rb
amp-0.5.0 test/merge_tests/test_merge.rb