| Class | URI::GenericEx::Test |
| In: |
lib/uri/generic_ex.rb
|
| Parent: | Test::Unit::TestCase |
# File lib/uri/generic_ex.rb, line 106 def setup assert_nothing_raised { @foo = URI.parse('http://foo/qux/bar') } assert_nothing_raised do @cmplx = URI.parse('http://foo@bar/qux/bob?a=b,c,d=e,f,ghi,jkl=mno') end end
# File lib/uri/generic_ex.rb, line 113 def teardown URI::GenericEx.remove_subclasses load 'uri/druby.rb' # FIXME load 'uri/file.rb' # FIXME end
# File lib/uri/generic_ex.rb, line 146 def test_lazy_loading_full PathList[__FILE__.to_path.dirname.parent + '(uri/**/*).rb'].each do |full, path| assert_nothing_raised do next if path.to_s == 'uri/generic_ex' class_name = path.to_s.gsub(/_ex$/, '').camelize class_object = class_name.constantize assert_equal class_name, class_object.name assert_match(/URI::Generic(Ex)?/, class_object.superclass.name, "Superclass of #{class_object}") end end end
# File lib/uri/generic_ex.rb, line 131 def test_lazy_loading_one assert_nothing_raised do assert_equal 'URI::DRuby', URI::DRuby.name assert_equal URI::GenericEx, URI::DRuby.superclass end end
# File lib/uri/generic_ex.rb, line 138 def test_lazy_loading_one2 assert_equal 'File', ::File.name assert_nothing_raised do assert_equal 'URI::File', 'URI::File'.constantize.name assert_equal URI::GenericEx, 'URI::File'.constantize.superclass end end
# File lib/uri/generic_ex.rb, line 126 def test_mk_custom_opts assert_equal([], @foo.mk_custom_opts) assert_equal(%w[-a b -c -d e -f --ghi --jkl mno], @cmplx.mk_custom_opts) end