summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-24 11:18:59 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-24 11:18:59 +0000
commitd004d83183bee33f76ec839eb6c3609fe5034398 (patch)
tree7170d20501ecc28a065f04a87e88f66f32fdd068 /test/unit
parent4a7de0cd63a12f0d99ed9bcbd2c52c46e578d0b7 (diff)
downloadredmine-d004d83183bee33f76ec839eb6c3609fe5034398.tar.gz
redmine-d004d83183bee33f76ec839eb6c3609fe5034398.zip
scm: mercurial: split unit model test setup whether repository required or not
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8962 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/repository_mercurial_test.rb40
1 files changed, 21 insertions, 19 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb
index 437b15f98..d4348e377 100644
--- a/test/unit/repository_mercurial_test.rb
+++ b/test/unit/repository_mercurial_test.rb
@@ -24,31 +24,33 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
NUM_REV = 32
CHAR_1_HEX = "\xc3\x9c"
+ def setup
+ @project = Project.find(3)
+ @repository = Repository::Mercurial.create(
+ :project => @project,
+ :url => REPOSITORY_PATH,
+ :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
+
if File.directory?(REPOSITORY_PATH)
- def setup
+ def test_scm_available
klass = Repository::Mercurial
assert_equal "Mercurial", klass.scm_name
assert klass.scm_adapter_class
assert_not_equal "", klass.scm_command
assert_equal true, klass.scm_available
-
- @project = Project.find(3)
- @repository = Repository::Mercurial.create(
- :project => @project,
- :url => REPOSITORY_PATH,
- :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_fetch_changesets_from_scratch