summaryrefslogtreecommitdiff
path: root/jni/ruby/test/rubygems/test_gem_uri_formatter.rb
diff options
context:
space:
mode:
authorJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-16 18:49:26 +0900
committerJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-30 00:39:06 +0900
commitfcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch)
tree64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/rubygems/test_gem_uri_formatter.rb
Fresh start
Diffstat (limited to 'jni/ruby/test/rubygems/test_gem_uri_formatter.rb')
-rw-r--r--jni/ruby/test/rubygems/test_gem_uri_formatter.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/jni/ruby/test/rubygems/test_gem_uri_formatter.rb b/jni/ruby/test/rubygems/test_gem_uri_formatter.rb
new file mode 100644
index 0000000..628b7c5
--- /dev/null
+++ b/jni/ruby/test/rubygems/test_gem_uri_formatter.rb
@@ -0,0 +1,28 @@
+require 'rubygems/test_case'
+require 'rubygems/uri_formatter'
+
+class TestGemUriFormatter < Gem::TestCase
+
+ def test_normalize_uri
+ assert_equal 'FILE://example/',
+ Gem::UriFormatter.new('FILE://example/').normalize
+ assert_equal 'FTP://example/',
+ Gem::UriFormatter.new('FTP://example/').normalize
+ assert_equal 'HTTP://example/',
+ Gem::UriFormatter.new('HTTP://example/').normalize
+ assert_equal 'HTTPS://example/',
+ Gem::UriFormatter.new('HTTPS://example/').normalize
+ assert_equal 'http://example/',
+ Gem::UriFormatter.new('example/').normalize
+ end
+
+ def test_escape
+ assert_equal 'a%40b%5Cc', Gem::UriFormatter.new('a@b\c').escape
+ end
+
+ def test_unescape
+ assert_equal 'a@b\c', Gem::UriFormatter.new('a%40b%5Cc').unescape
+ end
+
+end
+