Sha256: c375531e6d7749667a8891f3350aaf88df7cb2679ab13bf3b812cb0c39fa2a37

Contents?: true

Size: 1.34 KB

Versions: 36

Compression:

Stored size: 1.34 KB

Contents

# encoding: utf-8
require_relative '../test_helper'

module OhlohScm::Adapters
	class BzrCatFileTest < OhlohScm::Test

		def test_cat_file
			with_bzr_repository('bzr') do |bzr|
				expected = <<-EXPECTED
first file
second line
EXPECTED
				assert_equal expected,
					bzr.cat_file(OhlohScm::Commit::new(:token => 6),
						     OhlohScm::Diff.new(:path => "file1.txt"))

				# file2.txt has been removed in commit #5
				assert_equal nil, bzr.cat_file(bzr.head,
							       OhlohScm::Diff.new(:path => "file2.txt"))
			end
		end

    def test_cat_file_non_ascii_name
      with_bzr_repository('bzr') do |bzr|
        expected = <<-EXPECTED
first file
second line
EXPECTED
        assert_equal expected,
          bzr.cat_file(OhlohScm::Commit::new(:token => 7),
                 OhlohScm::Diff.new(:path => "Cédric.txt"))
      end
    end

		def test_cat_file_parent
			with_bzr_repository('bzr') do |bzr|
				expected = <<-EXPECTED
first file
second line
EXPECTED
				assert_equal expected,
					bzr.cat_file_parent(OhlohScm::Commit::new(:token => 6),
							    OhlohScm::Diff.new(:path => "file1.txt"))

				# file2.txt has been removed in commit #5
				expected = <<-EXPECTED
another file
EXPECTED
				assert_equal expected,
					bzr.cat_file_parent(OhlohScm::Commit.new(:token => 5),
							    OhlohScm::Diff.new(:path => "file2.txt"))
			end
		end

	end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ohloh_scm-2.5.1 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.14 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.13 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.12 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.11 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.10 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.9 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.8 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.7 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.6 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.5 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.4 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.3 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.1 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.4.0 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.3.5 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.3.4 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.3.2 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.3.1 test/unit/bzr_cat_file_test.rb
ohloh_scm-2.3.0 test/unit/bzr_cat_file_test.rb