aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri/test_common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/uri/test_common.rb')
-rw-r--r--test/uri/test_common.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb
index 1afa35f93d..311adc0049 100644
--- a/test/uri/test_common.rb
+++ b/test/uri/test_common.rb
@@ -33,6 +33,25 @@ class TestCommon < Test::Unit::TestCase
end
end
+ def test_ractor
+ return unless defined?(Ractor)
+ r = Ractor.new { URI.parse("https://ruby-lang.org/").inspect }
+ assert_equal(URI.parse("https://ruby-lang.org/").inspect, r.take)
+ end
+
+ def test_register_scheme
+ assert_equal(["FILE", "FTP", "HTTP", "HTTPS", "LDAP", "LDAPS", "MAILTO", "WS"].sort, URI.scheme_list.keys.sort)
+
+ begin
+ URI::Generic.const_set :FOOBAR, Class.new(URI::Generic)
+ URI.refresh_scheme_list
+ assert_equal(["FILE", "FTP", "HTTP", "HTTPS", "LDAP", "LDAPS", "MAILTO", "WS", "FOOBAR"].sort, URI.scheme_list.keys.sort)
+ ensure
+ URI::Generic.send(:remove_const, :FOOBAR)
+ URI.refresh_scheme_list
+ end
+ end
+
def test_regexp
EnvUtil.suppress_warning do
assert_instance_of Regexp, URI.regexp