diff options
author | Go MAEDA <maeda@farend.jp> | 2019-03-19 15:43:55 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-03-19 15:43:55 +0000 |
commit | 26509e7f4c6dae94baf291b95d46eb6ec8ebca0b (patch) | |
tree | eca8843de4ca00c229612e8f4f323a5474444a29 /test/unit/repository_mercurial_test.rb | |
parent | 7d2f10ccac0e51a8eb337ed388ab8182df4c25e1 (diff) | |
download | redmine-26509e7f4c6dae94baf291b95d46eb6ec8ebca0b.tar.gz redmine-26509e7f4c6dae94baf291b95d46eb6ec8ebca0b.zip |
Decode hexadecimal-encoded literals in order to be frozen string literals friendly (#31004).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@17991 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_mercurial_test.rb')
-rw-r--r-- | test/unit/repository_mercurial_test.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index 3f4ba6fbe..4500dfa21 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -27,9 +27,6 @@ class RepositoryMercurialTest < ActiveSupport::TestCase REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s NUM_REV = 34 - CHAR_1_HEX = "\xc3\x9c".force_encoding('UTF-8') - BRANCH_CHAR_1 = "branch-#{CHAR_1_HEX}-01".force_encoding('UTF-8') - def setup User.current = nil @project = Project.find(3) @@ -54,7 +51,6 @@ 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)".force_encoding('UTF-8') repo = Repository::Mercurial.new( :project => @project, :url => "", @@ -62,7 +58,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase :path_encoding => '' ) assert !repo.save - assert_include str, repo.errors.full_messages + assert_include 'Chemin du dépôt doit être renseigné(e)', repo.errors.full_messages end if File.directory?(REPOSITORY_PATH) @@ -356,11 +352,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-Ü-01') assert_equal %w|27 26|, changesets.collect(&:revision) end - changesets = @repository.latest_changesets("latin-1-dir/test-#{CHAR_1_HEX}-subdir", BRANCH_CHAR_1) + changesets = @repository.latest_changesets('latin-1-dir/test-Ü-subdir', 'branch-Ü-01') assert_equal %w|27|, changesets.collect(&:revision) end @@ -423,8 +419,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_HEX}-1.txt", c3[0].path - assert_equal "/latin-1-dir/test-#{CHAR_1_HEX}.txt", c3[0].from_path + assert_equal '/latin-1-dir/test-Ü-1.txt', c3[0].path + assert_equal '/latin-1-dir/test-Ü.txt', c3[0].from_path assert_equal scmid3, c3[0].from_revision end private :assert_copied_files |