summaryrefslogtreecommitdiffstats
path: root/test/unit/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-10-24 06:46:50 +0000
committerGo MAEDA <maeda@farend.jp>2020-10-24 06:46:50 +0000
commit78dfef097803532fee664461f6485175917c1990 (patch)
tree9442d8a37c382e347c1928c250b1d939b8ae6ee6 /test/unit/lib
parentb46953247da61845d7cd4600435c21012409aafb (diff)
downloadredmine-78dfef097803532fee664461f6485175917c1990.tar.gz
redmine-78dfef097803532fee664461f6485175917c1990.zip
Replace gsub with tr, delete, or squeeze (#34161).
git-svn-id: http://svn.redmine.org/redmine/trunk@20176 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
-rw-r--r--test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb2
-rw-r--r--test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb2
-rw-r--r--test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb
index 201a0e4e2..239e5ce30 100644
--- a/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb
@@ -21,7 +21,7 @@ require File.expand_path('../../../../../../test_helper', __FILE__)
class BazaarAdapterTest < ActiveSupport::TestCase
REPOSITORY_PATH = Rails.root.join('tmp/test/bazaar_repository').to_s
- REPOSITORY_PATH.gsub!(/\/+/, '/')
+ REPOSITORY_PATH.squeeze!('/')
if File.directory?(REPOSITORY_PATH)
def setup
diff --git a/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
index 0c679d6d2..f0ceca300 100644
--- a/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb
@@ -21,7 +21,7 @@ require File.expand_path('../../../../../../test_helper', __FILE__)
class CvsAdapterTest < ActiveSupport::TestCase
REPOSITORY_PATH = Rails.root.join('tmp/test/cvs_repository').to_s
- REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin?
+ REPOSITORY_PATH.tr!('/', "\\") if Redmine::Platform.mswin?
MODULE_NAME = 'test'
if File.directory?(REPOSITORY_PATH)
diff --git a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
index e0f506bfd..2c0b949c3 100644
--- a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
@@ -85,7 +85,7 @@ class MercurialAdapterTest < ActiveSupport::TestCase
[REPOSITORY_PATH, REPOSITORY_PATH + "/",
REPOSITORY_PATH + "//"].each do |repo|
adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo)
- repo_path = adp.info.root_url.gsub(/\\/, "/")
+ repo_path = adp.info.root_url.tr('\\', "/")
assert_equal REPOSITORY_PATH, repo_path
assert_equal '39', adp.info.lastrev.revision
assert_equal '04aed9840e9266e535f5f20f7e42c9f9f84f9cf4', adp.info.lastrev.scmid