summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-22 00:40:02 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-22 00:40:02 +0000
commit069d0571433c9c917f945e000128010ed70d0201 (patch)
tree181d3e62e23c2ac086ac1faaec511571847ca129 /test
parent496f22e42209474cf7f9a0c79e5720f94f23ed0b (diff)
downloadredmine-069d0571433c9c917f945e000128010ed70d0201.tar.gz
redmine-069d0571433c9c917f945e000128010ed70d0201.zip
scm: git: Ruby 1.9 compatibility of adapter test (#3396).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4918 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/scm/adapters/git_adapter_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
index 52aecd929..d86b120d4 100644
--- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
@@ -10,6 +10,9 @@ begin
class GitAdapterTest < ActiveSupport::TestCase
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/git_repository'
+ FELIX_UTF8 = "Felix Schäfer"
+ FELIX_HEX = "Felix Sch\xC3\xA4fer"
+
if File.directory?(REPOSITORY_PATH)
def setup
@adapter = Redmine::Scm::Adapters::GitAdapter.new(REPOSITORY_PATH)
@@ -81,9 +84,17 @@ begin
def test_last_rev_with_spaces_in_filename
last_rev = @adapter.lastrev("filemane with spaces.txt",
"ed5bb786bbda2dee66a2d50faf51429dbc043a7b")
+ str_felix_utf8 = FELIX_UTF8
+ str_felix_hex = FELIX_HEX
+ last_rev_author = last_rev.author
+ if last_rev_author.respond_to?(:force_encoding)
+ last_rev_author.force_encoding('UTF-8')
+ end
assert_equal "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", last_rev.scmid
assert_equal "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", last_rev.identifier
- assert_equal "Felix Schäfer <felix@fachschaften.org>",
+ assert_equal "#{str_felix_utf8} <felix@fachschaften.org>",
+ last_rev.author
+ assert_equal "#{str_felix_hex} <felix@fachschaften.org>",
last_rev.author
assert_equal "2010-09-18 19:59:46".to_time, last_rev.time
end