]> source.dussan.org Git - redmine.git/commitdiff
scm: bazaar: add unit adapter test to get .bzr/branch/branch.conf path from specified...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 25 May 2011 07:46:38 +0000 (07:46 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 25 May 2011 07:46:38 +0000 (07:46 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5891 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb

index b88124c6ac570dd1ac1564e2eec11484d2987764..23a74314ff5211530ec53ac67f12f1cf772cbdf2 100644 (file)
@@ -34,6 +34,24 @@ begin
         assert_equal 'mkdir', annotate.lines[0]
       end
 
+      def test_branch_conf_path
+        p = "c:\\test\\test\\"
+        bcp = Redmine::Scm::Adapters::BazaarAdapter.branch_conf_path(p)
+        assert_equal File.join("c:\\test\\test", ".bzr", "branch", "branch.conf"), bcp
+        p = "c:\\test\\test\\.bzr"
+        bcp = Redmine::Scm::Adapters::BazaarAdapter.branch_conf_path(p)
+        assert_equal File.join("c:\\test\\test", ".bzr", "branch", "branch.conf"), bcp
+        p = "c:\\test\\test\\.bzr\\"
+        bcp = Redmine::Scm::Adapters::BazaarAdapter.branch_conf_path(p)
+        assert_equal File.join("c:\\test\\test", ".bzr", "branch", "branch.conf"), bcp
+        p = "c:\\test\\test"
+        bcp = Redmine::Scm::Adapters::BazaarAdapter.branch_conf_path(p)
+        assert_equal File.join("c:\\test\\test", ".bzr", "branch", "branch.conf"), bcp
+        p = "\\\\server\\test\\test\\"
+        bcp = Redmine::Scm::Adapters::BazaarAdapter.branch_conf_path(p)
+        assert_equal File.join("\\\\server\\test\\test", ".bzr", "branch", "branch.conf"), bcp
+      end
+
       private
 
       def test_scm_version_for(scm_command_version, version)