diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-22 17:37:16 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-22 17:37:16 +0000 |
commit | 2d1866d966d94c688f9cb87c5bf3f096dffac844 (patch) | |
tree | 7a733c1cc51448ab69b3f892285305dbfb0ae15e /test/unit/repository_mercurial_test.rb | |
parent | a6ec78a4dc658e3517ed682792016b6530458696 (diff) | |
download | redmine-2d1866d966d94c688f9cb87c5bf3f096dffac844.tar.gz redmine-2d1866d966d94c688f9cb87c5bf3f096dffac844.zip |
Merged rails-4.1 branch (#14534).
git-svn-id: http://svn.redmine.org/redmine/trunk@13482 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_mercurial_test.rb')
-rw-r--r-- | test/unit/repository_mercurial_test.rb | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index 9762e47a9..0518055a2 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -24,7 +24,9 @@ class RepositoryMercurialTest < ActiveSupport::TestCase REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s NUM_REV = 34 - CHAR_1_HEX = "\xc3\x9c" + + CHAR_1_HEX = "\xc3\x9c".force_encoding('UTF-8') + BRANCH_CHAR_1 = "branch-#{CHAR_1_HEX}-01".force_encoding('UTF-8') def setup @project = Project.find(3) @@ -34,16 +36,6 @@ class RepositoryMercurialTest < ActiveSupport::TestCase :path_encoding => 'ISO-8859-1' ) assert @repository - @char_1 = CHAR_1_HEX.dup - @tag_char_1 = "tag-#{CHAR_1_HEX}-00" - @branch_char_0 = "branch-#{CHAR_1_HEX}-00" - @branch_char_1 = "branch-#{CHAR_1_HEX}-01" - if @char_1.respond_to?(:force_encoding) - @char_1.force_encoding('UTF-8') - @tag_char_1.force_encoding('UTF-8') - @branch_char_0.force_encoding('UTF-8') - @branch_char_1.force_encoding('UTF-8') - end end def test_blank_path_to_repository_error_message @@ -59,8 +51,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase def test_blank_path_to_repository_error_message_fr set_language_if_valid 'fr' - str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)" - str.force_encoding('UTF-8') if str.respond_to?(:force_encoding) + str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)".force_encoding('UTF-8') repo = Repository::Mercurial.new( :project => @project, :url => "", @@ -362,11 +353,11 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_equal NUM_REV, @repository.changesets.count if @repository.scm.class.client_version_above?([1, 6]) - changesets = @repository.latest_changesets('', @branch_char_1) + changesets = @repository.latest_changesets('', BRANCH_CHAR_1) assert_equal %w|27 26|, changesets.collect(&:revision) end - changesets = @repository.latest_changesets("latin-1-dir/test-#{@char_1}-subdir", @branch_char_1) + changesets = @repository.latest_changesets("latin-1-dir/test-#{CHAR_1_HEX}-subdir", BRANCH_CHAR_1) assert_equal %w|27|, changesets.collect(&:revision) end @@ -429,8 +420,8 @@ class RepositoryMercurialTest < ActiveSupport::TestCase scmid3 = scmid_for_assert(hex3, is_short_scmid) assert_equal 1, c3.size assert_equal 'A', c3[0].action - assert_equal "/latin-1-dir/test-#{@char_1}-1.txt", c3[0].path - assert_equal "/latin-1-dir/test-#{@char_1}.txt", c3[0].from_path + assert_equal "/latin-1-dir/test-#{CHAR_1_HEX}-1.txt", c3[0].path + assert_equal "/latin-1-dir/test-#{CHAR_1_HEX}.txt", c3[0].from_path assert_equal scmid3, c3[0].from_revision end private :assert_copied_files |