summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_local_remote_options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_local_remote_options.rb')
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb23
1 files changed, 12 insertions, 11 deletions
diff --git a/test/rubygems/test_gem_local_remote_options.rb b/test/rubygems/test_gem_local_remote_options.rb
index 2373bbde1f..cea9cde82b 100644
--- a/test/rubygems/test_gem_local_remote_options.rb
+++ b/test/rubygems/test_gem_local_remote_options.rb
@@ -1,13 +1,14 @@
# frozen_string_literal: true
-require 'rubygems/test_case'
-require 'rubygems/local_remote_options'
-require 'rubygems/command'
+
+require_relative "helper"
+require "rubygems/local_remote_options"
+require "rubygems/command"
class TestGemLocalRemoteOptions < Gem::TestCase
def setup
super
- @cmd = Gem::Command.new 'dummy', 'dummy'
+ @cmd = Gem::Command.new "dummy", "dummy"
@cmd.extend Gem::LocalRemoteOptions
end
@@ -33,7 +34,7 @@ class TestGemLocalRemoteOptions < Gem::TestCase
def test_clear_sources_option
@cmd.add_local_remote_options
- s = URI.parse "http://only-gems.example.com/"
+ s = Gem::URI.parse "http://only-gems.example.com/"
@cmd.handle_options %W[--clear-sources --source #{s}]
assert_equal [s.to_s], Gem.sources
@@ -75,10 +76,10 @@ class TestGemLocalRemoteOptions < Gem::TestCase
def test_source_option
@cmd.add_source_option
- s1 = URI.parse 'http://more-gems.example.com/'
- s2 = URI.parse 'http://even-more-gems.example.com/'
- s3 = URI.parse 'http://other-gems.example.com/some_subdir'
- s4 = URI.parse 'http://more-gems.example.com/' # Intentional duplicate
+ s1 = Gem::URI.parse "http://more-gems.example.com/"
+ s2 = Gem::URI.parse "http://even-more-gems.example.com/"
+ s3 = Gem::URI.parse "http://other-gems.example.com/some_subdir"
+ s4 = Gem::URI.parse "http://more-gems.example.com/" # Intentional duplicate
original_sources = Gem.sources.dup
@@ -96,7 +97,7 @@ class TestGemLocalRemoteOptions < Gem::TestCase
original_sources = Gem.sources.dup
- source = URI.parse 'http://more-gems.example.com/'
+ source = Gem::URI.parse "http://more-gems.example.com/"
@cmd.handle_options %W[-s #{source}]
original_sources << source
@@ -121,7 +122,7 @@ class TestGemLocalRemoteOptions < Gem::TestCase
def test_source_option_bad
@cmd.add_source_option
- s1 = 'htp://more-gems.example.com'
+ s1 = "htp://more-gems.example.com"
assert_raise ArgumentError do
@cmd.handle_options %W[--source #{s1}]