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
This commit is contained in:
Toshi MARUYAMA 2012-02-24 11:18:59 +00:00
parent 4a7de0cd63
commit d004d83183
1 changed files with 21 additions and 19 deletions

View File

@ -24,14 +24,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
NUM_REV = 32 NUM_REV = 32
CHAR_1_HEX = "\xc3\x9c" CHAR_1_HEX = "\xc3\x9c"
if File.directory?(REPOSITORY_PATH)
def setup def setup
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) @project = Project.find(3)
@repository = Repository::Mercurial.create( @repository = Repository::Mercurial.create(
:project => @project, :project => @project,
@ -51,6 +44,15 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
end end
end end
if File.directory?(REPOSITORY_PATH)
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
end
def test_fetch_changesets_from_scratch def test_fetch_changesets_from_scratch
assert_equal 0, @repository.changesets.count assert_equal 0, @repository.changesets.count
@repository.fetch_changesets @repository.fetch_changesets