rhodes 3.2.0.beta.4 → 3.2.0.beta.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Manifest.txt +517 -23
- data/Rakefile +52 -7
- data/doc/build.txt +7 -1
- data/doc/device-caps.txt +1 -1
- data/doc/install.txt +12 -0
- data/doc/jqt-jqm-transition.txt +121 -0
- data/doc/release.txt +6 -1
- data/doc/ui.txt +4 -2
- data/installer/icon.ico +0 -0
- data/lib/extensions/barcode/ext/barcode/shared/src/zbar.c +7 -0
- data/lib/extensions/barcode/ext/barcode/shared/zbar/rho_bridge.c +3 -3
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/README.TXT +74 -3
- data/lib/extensions/fcntl/ext/Rakefile +57 -38
- data/lib/extensions/fcntl/ext/build.bat +1 -0
- data/lib/extensions/fcntl/ext/fcntl.vcproj +323 -0
- data/lib/extensions/fileutils/fileutils.rb +57 -33
- data/lib/extensions/net-http/net/ftp.rb +40 -36
- data/lib/extensions/net-http/net/http.rb +98 -38
- data/lib/extensions/net-http/net/https.rb +3 -13
- data/lib/extensions/net-http/net/protocol.rb +20 -4
- data/lib/extensions/rexml/rexml/document.rb +11 -9
- data/lib/extensions/rexml/rexml/element.rb +1 -1
- data/lib/extensions/rexml/rexml/entity.rb +1 -1
- data/lib/extensions/rexml/rexml/formatters/default.rb +3 -1
- data/lib/extensions/rexml/rexml/formatters/pretty.rb +1 -1
- data/lib/extensions/rexml/rexml/light/node.rb +1 -2
- data/lib/extensions/rexml/rexml/parent.rb +1 -0
- data/lib/extensions/rexml/rexml/parsers/xpathparser.rb +2 -1
- data/lib/extensions/rexml/rexml/quickpath.rb +4 -1
- data/lib/extensions/rexml/rexml/rexml.rb +1 -1
- data/lib/extensions/rexml/rexml/source.rb +25 -14
- data/lib/extensions/rexml/rexml/text.rb +20 -21
- data/lib/extensions/rexml/rexml/xmldecl.rb +2 -2
- data/lib/extensions/rexml/rexml/xmltokens.rb +2 -2
- data/lib/extensions/rexml/rexml/xpath_parser.rb +2 -1
- data/lib/extensions/set/set.rb +100 -25
- data/lib/extensions/uri/uri/common.rb +134 -4
- data/lib/extensions/uri/uri/ftp.rb +14 -3
- data/lib/extensions/uri/uri/generic.rb +53 -44
- data/lib/extensions/uri/uri/http.rb +1 -1
- data/lib/extensions/uri/uri/https.rb +1 -1
- data/lib/extensions/uri/uri/ldap.rb +1 -1
- data/lib/extensions/uri/uri/mailto.rb +9 -9
- data/lib/framework/rho/rhoviewhelpers.rb +3 -2
- data/lib/framework/rholang/localization_simplified.rb +5 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Logger.java +14 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCaptureCallback.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +12 -5
- data/platform/android/build/android.rake +7 -7
- data/platform/iphone/Classes/AppManager/AppManager.m +19 -7
- data/platform/iphone/rbuild/iphone.rake +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/phonon.framework/Versions/4/phonon +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/phonon_backend/libphonon_qt7.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Resources/rho.icns +0 -0
- data/platform/osx/build/osx.rake +25 -3
- data/platform/shared/common/AutoPointer.h +1 -1
- data/platform/shared/common/RhoStd.h +10 -10
- data/platform/shared/common/RhodesAppBase.cpp +3 -0
- data/platform/shared/logging/RhoLogConf.cpp +1 -1
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +7 -0
- data/platform/shared/qt/rhodes/RhoSimulator.h +3 -1
- data/platform/shared/qt/rhodes/main.cpp +3 -0
- data/platform/shared/qt/rhodes/resources/rho.icns +0 -0
- data/platform/shared/qt/rhodes/resources/rho.ico +0 -0
- data/platform/shared/qt/rhodes/resources/rho.png +0 -0
- data/platform/shared/qt/rhodes/resources/simulator.qrc +5 -0
- data/platform/shared/qt/rhodes/rhodes.pro +2 -0
- data/platform/shared/ruby/ext/rho/rhosupport.c +21 -2
- data/platform/shared/ruby/ext/socket_192/addrinfo.h +191 -0
- data/platform/shared/ruby/ext/socket_192/ancdata.c +1800 -0
- data/platform/shared/ruby/ext/socket_192/basicsocket.c +771 -0
- data/platform/shared/ruby/ext/socket_192/constants.c +145 -0
- data/platform/shared/ruby/ext/socket_192/depend +25 -0
- data/platform/shared/ruby/ext/socket_192/extconf.rb +365 -0
- data/platform/shared/ruby/ext/socket_192/getaddrinfo.c +674 -0
- data/platform/shared/ruby/ext/socket_192/getnameinfo.c +260 -0
- data/platform/shared/ruby/ext/socket_192/init.c +575 -0
- data/platform/shared/ruby/ext/socket_192/ipsocket.c +308 -0
- data/platform/shared/ruby/ext/socket_192/lib/socket.rb +755 -0
- data/platform/shared/ruby/ext/socket_192/mkconstants.rb +696 -0
- data/platform/shared/ruby/ext/socket_192/option.c +692 -0
- data/platform/shared/ruby/ext/socket_192/raddrinfo.c +2211 -0
- data/platform/shared/ruby/ext/socket_192/rubysocket.h +306 -0
- data/platform/shared/ruby/ext/socket_192/socket.c +1870 -0
- data/platform/shared/ruby/ext/socket_192/sockport.h +84 -0
- data/platform/shared/ruby/ext/socket_192/sockssocket.c +58 -0
- data/platform/shared/ruby/ext/socket_192/tcpserver.c +145 -0
- data/platform/shared/ruby/ext/socket_192/tcpsocket.c +69 -0
- data/platform/shared/ruby/ext/socket_192/udpsocket.c +264 -0
- data/platform/shared/ruby/ext/socket_192/unixserver.c +154 -0
- data/platform/shared/ruby/ext/socket_192/unixsocket.c +514 -0
- data/platform/shared/ruby/ext/stringio/stringio.c +158 -61
- data/platform/shared/ruby/ext/strscan/strscan.c +18 -31
- data/platform/shared/ruby/iphone/ruby/config.h +2 -1
- data/platform/shared/ruby/linux/ruby/config.h +2 -1
- data/platform/shared/ruby/symbian/ruby/config.h +2 -1
- data/platform/shared/ruby/win32/ruby/config.h +1 -0
- data/platform/shared/ruby/win32/ruby/constdefs.c +5866 -0
- data/platform/shared/ruby/win32/ruby/constdefs.h +1788 -0
- data/platform/shared/ruby/wince/ruby/config.h +1 -0
- data/platform/shared/ruby/wince/ruby/constdefs.c +5866 -0
- data/platform/shared/ruby/wince/ruby/constdefs.h +1788 -0
- data/platform/symbian/build/symbian.rake +8 -0
- data/platform/symbian/rhodes/rhodes.pro +3 -3
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/wm/build/wm.rake +1 -1
- data/platform/wm/rhodes/Rhodes.cpp +3 -0
- data/platform/wm/rhodes/rhodes.vcproj +612 -6
- data/platform/wm/rhodes/rhosim.rc +394 -0
- data/platform/wm/rhodes/simulator/MainWindowQt.cpp +2 -2
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +8 -2
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +5 -1
- data/platform/wp7/build/wp.rake +1 -1
- data/rakefile.rb +52 -7
- data/res/generators/templates/application/app/layout.erb +4 -4
- data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0b3.css → jquery.mobile-1.0rc1.css} +507 -457
- data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0b3.js → jquery.mobile-1.0rc1.js} +565 -458
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.css +12 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.js +170 -0
- data/res/generators/templates/application/public/jquery/{jquery-1.6.3.js → jquery-1.6.4.js} +10 -8
- data/res/generators/templates/application/public/jquery/jquery-1.6.4.min.js +4 -0
- data/res/generators/templates/application/public/js/jqmobile-patch.js +47 -1
- data/res/icons/rho.icns +0 -0
- data/res/icons/rho.ico +0 -0
- data/res/icons/rho.png +0 -0
- data/res/icons/rho.psd +0 -0
- data/res/icons/rhodes.icns +0 -0
- data/res/icons/rhodes.ico +0 -0
- data/res/icons/rhodes.png +0 -0
- data/res/icons/rhodes.psd +0 -0
- data/res/icons/rhosim.icns +0 -0
- data/res/icons/rhosim.ico +0 -0
- data/res/icons/rhosim.png +0 -0
- data/res/icons/rhosim.psd +0 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +4 -4
- data/spec/framework_spec/app/spec/library/net/FTPError_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/FTPPermError_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/FTPProtoError_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/FTPReplyError_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/FTPTempError_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/ftp/abort_spec.rb +62 -0
- data/spec/framework_spec/app/spec/library/net/ftp/acct_spec.rb +58 -0
- data/spec/framework_spec/app/spec/library/net/ftp/binary_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/ftp/chdir_spec.rb +101 -0
- data/spec/framework_spec/app/spec/library/net/ftp/close_spec.rb +28 -0
- data/spec/framework_spec/app/spec/library/net/ftp/closed_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/net/ftp/connect_spec.rb +49 -0
- data/spec/framework_spec/app/spec/library/net/ftp/debug_mode_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/net/ftp/delete_spec.rb +59 -0
- data/spec/framework_spec/app/spec/library/net/ftp/dir_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/fixtures/putbinaryfile +3 -0
- data/spec/framework_spec/app/spec/library/net/ftp/fixtures/puttextfile +3 -0
- data/spec/framework_spec/app/spec/library/net/ftp/fixtures/server.rb +258 -0
- data/spec/framework_spec/app/spec/library/net/ftp/get_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/net/ftp/getbinaryfile_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/getdir_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/net/ftp/gettextfile_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/help_spec.rb +66 -0
- data/spec/framework_spec/app/spec/library/net/ftp/initialize_spec.rb +87 -0
- data/spec/framework_spec/app/spec/library/net/ftp/last_response_code_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/last_response_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/net/ftp/lastresp_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/list_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/login_spec.rb +216 -0
- data/spec/framework_spec/app/spec/library/net/ftp/ls_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/mdtm_spec.rb +38 -0
- data/spec/framework_spec/app/spec/library/net/ftp/mkdir_spec.rb +61 -0
- data/spec/framework_spec/app/spec/library/net/ftp/mtime_spec.rb +50 -0
- data/spec/framework_spec/app/spec/library/net/ftp/nlst_spec.rb +122 -0
- data/spec/framework_spec/app/spec/library/net/ftp/noop_spec.rb +38 -0
- data/spec/framework_spec/app/spec/library/net/ftp/open_spec.rb +55 -0
- data/spec/framework_spec/app/spec/library/net/ftp/passive_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/ftp/put_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/net/ftp/putbinaryfile_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/puttextfile_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/pwd_spec.rb +53 -0
- data/spec/framework_spec/app/spec/library/net/ftp/quit_spec.rb +33 -0
- data/spec/framework_spec/app/spec/library/net/ftp/rename_spec.rb +94 -0
- data/spec/framework_spec/app/spec/library/net/ftp/resume_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/net/ftp/retrlines_spec.rb +35 -0
- data/spec/framework_spec/app/spec/library/net/ftp/return_code_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/ftp/rmdir_spec.rb +58 -0
- data/spec/framework_spec/app/spec/library/net/ftp/sendcmd_spec.rb +54 -0
- data/spec/framework_spec/app/spec/library/net/ftp/set_socket_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/ftp/shared/getbinaryfile.rb +180 -0
- data/spec/framework_spec/app/spec/library/net/ftp/shared/gettextfile.rb +130 -0
- data/spec/framework_spec/app/spec/library/net/ftp/shared/last_response_code.rb +25 -0
- data/spec/framework_spec/app/spec/library/net/ftp/shared/list.rb +134 -0
- data/spec/framework_spec/app/spec/library/net/ftp/shared/putbinaryfile.rb +233 -0
- data/spec/framework_spec/app/spec/library/net/ftp/shared/puttextfile.rb +150 -0
- data/spec/framework_spec/app/spec/library/net/ftp/shared/pwd.rb +3 -0
- data/spec/framework_spec/app/spec/library/net/ftp/site_spec.rb +53 -0
- data/spec/framework_spec/app/spec/library/net/ftp/size_spec.rb +48 -0
- data/spec/framework_spec/app/spec/library/net/ftp/status_spec.rb +63 -0
- data/spec/framework_spec/app/spec/library/net/ftp/storbinary_spec.rb +49 -0
- data/spec/framework_spec/app/spec/library/net/ftp/storlines_spec.rb +44 -0
- data/spec/framework_spec/app/spec/library/net/ftp/system_spec.rb +48 -0
- data/spec/framework_spec/app/spec/library/net/ftp/voidcmd_spec.rb +54 -0
- data/spec/framework_spec/app/spec/library/net/ftp/welcome_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/net/http/HTTPBadResponse_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/HTTPError_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/http/HTTPFatalError_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/http/HTTPHeaderSyntaxError_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/HTTPRetriableError_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/http/HTTPServerException_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/http/http/Proxy_spec.rb +35 -0
- data/spec/framework_spec/app/spec/library/net/http/http/active_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/address_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/http/close_on_empty_response_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/net/http/http/copy_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/net/http/http/default_port_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/delete_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/net/http/http/finish_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/net/http/http/fixtures/http_server.rb +97 -0
- data/spec/framework_spec/app/spec/library/net/http/http/get2_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/get_print_spec.rb +29 -0
- data/spec/framework_spec/app/spec/library/net/http/http/get_response_spec.rb +29 -0
- data/spec/framework_spec/app/spec/library/net/http/http/get_spec.rb +52 -0
- data/spec/framework_spec/app/spec/library/net/http/http/head2_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/http/head_spec.rb +27 -0
- data/spec/framework_spec/app/spec/library/net/http/http/http_default_port_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/https_default_port_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/initialize_spec.rb +46 -0
- data/spec/framework_spec/app/spec/library/net/http/http/inspect_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/net/http/http/is_version_1_1_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/net/http/http/is_version_1_2_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/net/http/http/lock_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/net/http/http/mkcol_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/net/http/http/move_spec.rb +27 -0
- data/spec/framework_spec/app/spec/library/net/http/http/new_spec.rb +86 -0
- data/spec/framework_spec/app/spec/library/net/http/http/newobj_spec.rb +48 -0
- data/spec/framework_spec/app/spec/library/net/http/http/open_timeout_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/http/http/options_spec.rb +27 -0
- data/spec/framework_spec/app/spec/library/net/http/http/port_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/http/post2_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/post_form_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/net/http/http/post_spec.rb +40 -0
- data/spec/framework_spec/app/spec/library/net/http/http/propfind_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/net/http/http/proppatch_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/net/http/http/proxy_address_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/net/http/http/proxy_class_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/http/proxy_pass_spec.rb +39 -0
- data/spec/framework_spec/app/spec/library/net/http/http/proxy_port_spec.rb +39 -0
- data/spec/framework_spec/app/spec/library/net/http/http/proxy_user_spec.rb +39 -0
- data/spec/framework_spec/app/spec/library/net/http/http/put2_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/put_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/net/http/http/read_timeout_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/http/http/request_get_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/request_head_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/request_post_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/request_put_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/request_spec.rb +111 -0
- data/spec/framework_spec/app/spec/library/net/http/http/request_types_spec.rb +254 -0
- data/spec/framework_spec/app/spec/library/net/http/http/send_request_spec.rb +120 -0
- data/spec/framework_spec/app/spec/library/net/http/http/set_debug_output_spec.rb +35 -0
- data/spec/framework_spec/app/spec/library/net/http/http/shared/request_get.rb +45 -0
- data/spec/framework_spec/app/spec/library/net/http/http/shared/request_head.rb +45 -0
- data/spec/framework_spec/app/spec/library/net/http/http/shared/request_post.rb +45 -0
- data/spec/framework_spec/app/spec/library/net/http/http/shared/request_put.rb +45 -0
- data/spec/framework_spec/app/spec/library/net/http/http/shared/started.rb +28 -0
- data/spec/framework_spec/app/spec/library/net/http/http/shared/version_1_1.rb +19 -0
- data/spec/framework_spec/app/spec/library/net/http/http/shared/version_1_2.rb +6 -0
- data/spec/framework_spec/app/spec/library/net/http/http/socket_type_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/start_spec.rb +103 -0
- data/spec/framework_spec/app/spec/library/net/http/http/started_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/http/trace_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/net/http/http/unlock_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/net/http/http/use_ssl_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/http/version_1_1_spec.rb +22 -0
- data/spec/framework_spec/app/spec/library/net/http/http/version_1_2_spec.rb +20 -0
- data/spec/framework_spec/app/spec/library/net/http/httpexceptions/fixtures/classes.rb +5 -0
- data/spec/framework_spec/app/spec/library/net/http/httpexceptions/initialize_spec.rb +17 -0
- data/spec/framework_spec/app/spec/library/net/http/httpexceptions/response_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_exist_spec.rb +27 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_spec.rb +30 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb +32 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/exec_spec.rb +122 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/inspect_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/method_spec.rb +15 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/path_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/request_body_permitted_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/response_body_permitted_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/set_body_internal_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/add_field_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/basic_auth_spec.rb +14 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/canonical_each_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/chunked_spec.rb +22 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/content_length_spec.rb +54 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/content_range_spec.rb +34 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/content_type_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/delete_spec.rb +30 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/each_capitalized_name_spec.rb +45 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/each_capitalized_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/each_header_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/each_key_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/each_name_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/each_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/each_value_spec.rb +46 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/element_reference_spec.rb +39 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/element_set_spec.rb +41 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/fetch_spec.rb +69 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/fixtures/classes.rb +11 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/form_data_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/get_fields_spec.rb +39 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/initialize_http_header_spec.rb +29 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/key_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/length_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/main_type_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/proxy_basic_auth_spec.rb +14 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/range_length_spec.rb +32 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/range_spec.rb +48 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/set_content_type_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/set_form_data_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/set_range_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/each_capitalized.rb +42 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/each_header.rb +42 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/each_name.rb +39 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/set_content_type.rb +18 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/set_form_data.rb +27 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/set_range.rb +89 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/size.rb +18 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/size_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/sub_type_spec.rb +32 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/to_hash_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/net/http/httpheader/type_params_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/http/httprequest/initialize_spec.rb +45 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/body_permitted_spec.rb +13 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/body_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/code_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/code_type_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/entity_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/error_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/error_type_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/exception_type_spec.rb +13 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/header_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/http_version_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/initialize_spec.rb +11 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/inspect_spec.rb +15 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/message_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/msg_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/read_body_spec.rb +86 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/read_header_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/read_new_spec.rb +22 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/reading_body_spec.rb +58 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/response_spec.rb +9 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/shared/body.rb +18 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/net/http/httpresponse/value_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/clone_spec.rb +11 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/element_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/equal_value_spec.rb +18 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/hash_spec.rb +13 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/initialize_spec.rb +29 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/inspect_spec.rb +20 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/namespace_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/node_type_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/prefix_spec.rb +18 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/remove_spec.rb +20 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/to_s_spec.rb +14 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/to_string_spec.rb +15 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/value_spec.rb +15 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/write_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/rexml/attribute/xpath_spec.rb +20 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/add_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/append_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/delete_all_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/delete_spec.rb +27 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/each_attribute_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/each_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/element_reference_spec.rb +19 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/element_set_spec.rb +26 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/get_attribute_ns_spec.rb +14 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/get_attribute_spec.rb +29 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/initialize_spec.rb +19 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/length_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/namespaces_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/prefixes_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/shared/add.rb +17 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/shared/length.rb +13 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/size_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/rexml/attributes/to_a_spec.rb +20 -0
- data/spec/framework_spec/app/spec/library/rexml/cdata/clone_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/rexml/cdata/initialize_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/rexml/cdata/shared/to_s.rb +11 -0
- data/spec/framework_spec/app/spec/library/rexml/cdata/to_s_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/rexml/cdata/value_spec.rb +7 -0
- data/spec/framework_spec/app/spec/library/rexml/document/add_element_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/rexml/document/add_spec.rb +61 -0
- data/spec/framework_spec/app/spec/library/rexml/document/clone_spec.rb +20 -0
- data/spec/framework_spec/app/spec/library/rexml/document/doctype_spec.rb +15 -0
- data/spec/framework_spec/app/spec/library/rexml/document/encoding_spec.rb +22 -0
- data/spec/framework_spec/app/spec/library/rexml/document/expanded_name_spec.rb +16 -0
- data/spec/framework_spec/app/spec/library/rexml/document/new_spec.rb +38 -0
- data/spec/framework_spec/app/spec/library/rexml/document/node_type_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/rexml/document/root_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/rexml/document/stand_alone_spec.rb +19 -0
- data/spec/framework_spec/app/spec/library/rexml/document/version_spec.rb +14 -0
- data/spec/framework_spec/app/spec/library/rexml/document/write_spec.rb +39 -0
- data/spec/framework_spec/app/spec/library/rexml/document/xml_decl_spec.rb +15 -0
- data/spec/framework_spec/app/spec/library/rexml/element/add_attribute_spec.rb +41 -0
- data/spec/framework_spec/app/spec/library/rexml/element/add_attributes_spec.rb +22 -0
- data/spec/framework_spec/app/spec/library/rexml/element/add_element_spec.rb +39 -0
- data/spec/framework_spec/app/spec/library/rexml/element/add_namespace_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/element/add_text_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/element/attribute_spec.rb +17 -0
- data/spec/framework_spec/app/spec/library/rexml/element/attributes_spec.rb +19 -0
- data/spec/framework_spec/app/spec/library/rexml/element/cdatas_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/element/clone_spec.rb +29 -0
- data/spec/framework_spec/app/spec/library/rexml/element/comments_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/rexml/element/delete_attribute_spec.rb +39 -0
- data/spec/framework_spec/app/spec/library/rexml/element/delete_element_spec.rb +51 -0
- data/spec/framework_spec/app/spec/library/rexml/element/delete_namespace_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/rexml/element/document_spec.rb +18 -0
- data/spec/framework_spec/app/spec/library/rexml/element/each_element_with_attribute_spec.rb +35 -0
- data/spec/framework_spec/app/spec/library/rexml/element/each_element_with_text_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb +18 -0
- data/spec/framework_spec/app/spec/library/rexml/element/has_attributes_spec.rb +17 -0
- data/spec/framework_spec/app/spec/library/rexml/element/has_elements_spec.rb +18 -0
- data/spec/framework_spec/app/spec/library/rexml/element/has_text_spec.rb +16 -0
- data/spec/framework_spec/app/spec/library/rexml/element/inspect_spec.rb +27 -0
- data/spec/framework_spec/app/spec/library/rexml/element/instructions_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/rexml/element/namespace_spec.rb +27 -0
- data/spec/framework_spec/app/spec/library/rexml/element/namespaces_spec.rb +32 -0
- data/spec/framework_spec/app/spec/library/rexml/element/new_spec.rb +35 -0
- data/spec/framework_spec/app/spec/library/rexml/element/next_element_spec.rb +19 -0
- data/spec/framework_spec/app/spec/library/rexml/element/node_type_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/rexml/element/prefixes_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/rexml/element/previous_element_spec.rb +20 -0
- data/spec/framework_spec/app/spec/library/rexml/element/raw_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/element/root_spec.rb +28 -0
- data/spec/framework_spec/app/spec/library/rexml/element/text_spec.rb +46 -0
- data/spec/framework_spec/app/spec/library/rexml/element/texts_spec.rb +16 -0
- data/spec/framework_spec/app/spec/library/rexml/element/whitespace_spec.rb +23 -0
- data/spec/framework_spec/app/spec/library/rexml/node/each_recursive_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/rexml/node/find_first_recursive_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/rexml/node/index_in_parent_spec.rb +15 -0
- data/spec/framework_spec/app/spec/library/rexml/node/next_sibling_node_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/rexml/node/parent_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/rexml/node/previous_sibling_node_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/rexml/shared/each_element.rb +36 -0
- data/spec/framework_spec/app/spec/library/rexml/shared/elements_to_a.rb +36 -0
- data/spec/framework_spec/app/spec/library/rexml/text/append_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/rexml/text/clone_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/rexml/text/comparison_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/rexml/text/empty_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/rexml/text/indent_text_spec.rb +24 -0
- data/spec/framework_spec/app/spec/library/rexml/text/inspect_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/rexml/text/new_spec.rb +49 -0
- data/spec/framework_spec/app/spec/library/rexml/text/node_type_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/rexml/text/normalize_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/rexml/text/read_with_substitution_spec.rb +13 -0
- data/spec/framework_spec/app/spec/library/rexml/text/to_s_spec.rb +18 -0
- data/spec/framework_spec/app/spec/library/rexml/text/unnormalize_spec.rb +8 -0
- data/spec/framework_spec/app/spec/library/rexml/text/value_spec.rb +37 -0
- data/spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb +21 -0
- data/spec/framework_spec/app/spec/library/rexml/text/write_with_substitution_spec.rb +33 -0
- data/spec/framework_spec/app/spec/library/set/exclusion_spec.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/merge_spec.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/shared/difference.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/shared/intersection.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/shared/union.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/sortedset/exclusion_spec.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/sortedset/merge_spec.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/sortedset/shared/difference.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/sortedset/shared/intersection.rb +2 -2
- data/spec/framework_spec/app/spec/library/set/sortedset/shared/union.rb +2 -2
- data/spec/framework_spec/app/spec/library/timeout/timeout_spec.rb +37 -0
- data/spec/framework_spec/app/spec/library/uri/eql_spec.rb +12 -0
- data/spec/framework_spec/app/spec/library/uri/equality_spec.rb +48 -0
- data/spec/framework_spec/app/spec/library/uri/escape/decode_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/escape/encode_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/escape/escape_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/escape/unescape_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/extract_spec.rb +86 -0
- data/spec/framework_spec/app/spec/library/uri/fixtures/classes.rb +11 -0
- data/spec/framework_spec/app/spec/library/uri/fixtures/normalization.rb +54 -0
- data/spec/framework_spec/app/spec/library/uri/ftp/build_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ftp/merge_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ftp/new2_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ftp/path_spec.rb +56 -0
- data/spec/framework_spec/app/spec/library/uri/ftp/set_typecode_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ftp/to_s_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/uri/ftp/typecode_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/absolute_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/build2_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/build_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/coerce_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/component_ary_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/component_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/default_port_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/eql_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/equal_value_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/fragment_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/hash_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/hierarchical_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/host_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/inspect_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/merge_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/minus_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/normalize_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/opaque_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/password_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/path_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/plus_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/port_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/query_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/registry_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/relative_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/route_from_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/route_to_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/scheme_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/select_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_fragment_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_host_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_opaque_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_password_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_path_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_port_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_query_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_registry_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_scheme_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_user_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/set_userinfo_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/to_s_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/use_registry_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/generic/user_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/generic/userinfo_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/http/build_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/http/request_uri_spec.rb +16 -0
- data/spec/framework_spec/app/spec/library/uri/join_spec.rb +61 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/attributes_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/build_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/dn_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/extensions_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/filter_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/hierarchical_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/scope_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/set_attributes_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/set_dn_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/set_extensions_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/set_filter_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/ldap/set_scope_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/mailto/build_spec.rb +99 -0
- data/spec/framework_spec/app/spec/library/uri/mailto/headers_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/mailto/set_headers_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/mailto/set_to_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/mailto/to_mailtext_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/mailto/to_rfc822text_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/mailto/to_s_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/mailto/to_spec.rb +10 -0
- data/spec/framework_spec/app/spec/library/uri/merge_spec.rb +22 -0
- data/spec/framework_spec/app/spec/library/uri/normalize_spec.rb +35 -0
- data/spec/framework_spec/app/spec/library/uri/parse_spec.rb +249 -0
- data/spec/framework_spec/app/spec/library/uri/plus_spec.rb +489 -0
- data/spec/framework_spec/app/spec/library/uri/regexp_spec.rb +18 -0
- data/spec/framework_spec/app/spec/library/uri/route_from_spec.rb +25 -0
- data/spec/framework_spec/app/spec/library/uri/route_to_spec.rb +28 -0
- data/spec/framework_spec/app/spec/library/uri/select_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/uri/set_component_spec.rb +47 -0
- data/spec/framework_spec/app/spec/library/uri/shared/eql.rb +17 -0
- data/spec/framework_spec/app/spec/library/uri/split_spec.rb +6 -0
- data/spec/framework_spec/app/spec/library/uri/uri_spec.rb +31 -0
- data/spec/framework_spec/app/spec/library/uri/util/make_components_hash_spec.rb +6 -0
- data/spec/framework_spec/build.yml +2 -2
- data/spec/framework_spec/extensions/test-libs/test/unit.rb +328 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/assertionfailederror.rb +25 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/assertions.rb +1878 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/attribute.rb +129 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/autorunner.rb +422 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/collector.rb +38 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/collector/descendant.rb +23 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/collector/dir.rb +108 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/collector/load.rb +187 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/collector/objectspace.rb +34 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/collector/xml.rb +250 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/color-scheme.rb +153 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/color.rb +123 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/data.rb +80 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/diff.rb +740 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/error.rb +151 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/exceptionhandler.rb +39 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/failure.rb +136 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/fixture.rb +214 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/notification.rb +133 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/omission.rb +191 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/pending.rb +150 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/priority.rb +182 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/runner/console.rb +59 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/runner/emacs.rb +8 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/runner/tap.rb +8 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/runner/xml.rb +15 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/testcase.rb +601 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/testresult.rb +125 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/testsuite.rb +134 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/testsuitecreator.rb +79 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/ui/console/outputlevel.rb +15 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/ui/console/testrunner.rb +561 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb +63 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/ui/tap/testrunner.rb +82 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/ui/testrunner.rb +53 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/ui/testrunnermediator.rb +86 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/ui/testrunnerutilities.rb +41 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/ui/xml/testrunner.rb +224 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/util/backtracefilter.rb +42 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/util/method-owner-finder.rb +28 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/util/observable.rb +90 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/util/output.rb +31 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/util/procwrapper.rb +48 -0
- data/spec/framework_spec/extensions/test-libs/test/unit/version.rb +5 -0
- data/spec/framework_spec/extensions/test-libs/webrick/accesslog.rb +10 -2
- data/spec/framework_spec/extensions/test-libs/webrick/cgi.rb +1 -1
- data/spec/framework_spec/extensions/test-libs/webrick/config.rb +1 -1
- data/spec/framework_spec/extensions/test-libs/webrick/httpauth/digestauth.rb +1 -1
- data/spec/framework_spec/extensions/test-libs/webrick/httpresponse.rb +1 -1
- data/spec/framework_spec/extensions/test-libs/webrick/https.rb +2 -2
- data/spec/framework_spec/extensions/test-libs/webrick/httpservlet/abstract.rb +1 -2
- data/spec/framework_spec/extensions/test-libs/webrick/httpservlet/cgihandler.rb +2 -2
- data/spec/framework_spec/extensions/test-libs/webrick/httpservlet/filehandler.rb +9 -5
- data/spec/framework_spec/extensions/test-libs/webrick/httpstatus.rb +32 -321
- data/spec/framework_spec/extensions/test-libs/webrick/httputils.rb +3 -3
- data/spec/framework_spec/extensions/test-libs/webrick/ssl.rb +3 -2
- data/spec/phone_spec/build.yml +1 -1
- data/version +1 -0
- metadata +521 -27
- data/lib/extensions/net-http/monitor.rb +0 -265
- data/lib/extensions/net-http/thread.rb +0 -367
- data/lib/extensions/net-http/timeout.rb +0 -114
- data/lib/extensions/net-http/uri.rb +0 -29
- data/lib/extensions/net-http/uri/common.rb +0 -727
- data/lib/extensions/net-http/uri/ftp.rb +0 -198
- data/lib/extensions/net-http/uri/generic.rb +0 -1128
- data/lib/extensions/net-http/uri/http.rb +0 -100
- data/lib/extensions/net-http/uri/https.rb +0 -20
- data/lib/extensions/net-http/uri/ldap.rb +0 -190
- data/lib/extensions/net-http/uri/ldaps.rb +0 -12
- data/lib/extensions/net-http/uri/mailto.rb +0 -266
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtDBus.framework/Versions/4/QtDBus +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtXml.framework/Versions/4/QtXml +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libtcpserver.dylib +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icon-search-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b3.min.css +0 -8
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b3.min.js +0 -169
- data/res/generators/templates/application/public/jquery/jquery-1.6.3.min.js +0 -4
- data/spec/framework_spec/extensions/test-libs/thread.rb +0 -391
@@ -0,0 +1,10 @@
|
|
1
|
+
require File.expand_path('../../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
describe "URI::MailTo#headers" do
|
5
|
+
it "needs to be reviewed for spec completeness"
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "URI::MailTo#headers=" do
|
9
|
+
it "needs to be reviewed for spec completeness"
|
10
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
describe "URI#merge" do
|
5
|
+
it "returns the receiver and the argument, joined as per URI.join" do
|
6
|
+
URI("http://localhost/").merge("main.rbx").should == URI.parse("http://localhost/main.rbx")
|
7
|
+
URI("http://localhost/a/b/c/d").merge("http://ruby-lang.com/foo").should == URI.parse("http://ruby-lang.com/foo")
|
8
|
+
URI("http://localhost/a/b/c/d").merge("../../e/f").to_s.should == "http://localhost/a/e/f"
|
9
|
+
end
|
10
|
+
|
11
|
+
it "accepts URI objects as argument" do
|
12
|
+
URI("http://localhost/").merge(URI("main.rbx")).should == URI.parse("http://localhost/main.rbx")
|
13
|
+
end
|
14
|
+
|
15
|
+
ruby_bug "redmine:3506", "1.9.2" do
|
16
|
+
it "accepts a string-like argument" do
|
17
|
+
str = mock('string-like')
|
18
|
+
str.should_receive(:to_str).and_return("foo/bar")
|
19
|
+
URI("http://localhost/").merge(str).should == URI.parse("http://localhost/foo/bar")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require File.expand_path('../fixtures/normalization', __FILE__)
|
3
|
+
require 'uri'
|
4
|
+
|
5
|
+
describe "URI#normalize" do
|
6
|
+
it "adds a / onto the end of the URI if the path is blank" do
|
7
|
+
no_path = URI("http://example.com")
|
8
|
+
no_path.to_s.should_not == "http://example.com/"
|
9
|
+
no_path.normalize.to_s.should == "http://example.com/"
|
10
|
+
end
|
11
|
+
|
12
|
+
it "downcases the host of the URI" do
|
13
|
+
uri = URI("http://exAMPLE.cOm/")
|
14
|
+
uri.to_s.should_not == "http://example.com/"
|
15
|
+
uri.normalize.to_s.should == "http://example.com/"
|
16
|
+
end
|
17
|
+
|
18
|
+
# The previous tests are included by the one below
|
19
|
+
|
20
|
+
quarantine! do # Quarantined until redmine:2542 is accepted
|
21
|
+
it "respects RFC 3986" do
|
22
|
+
URISpec::NORMALIZED_FORMS.each do |form|
|
23
|
+
normal_uri = URI(form[:normalized])
|
24
|
+
normalized = normal_uri.normalize.to_s
|
25
|
+
normal_uri.to_s.should == normalized
|
26
|
+
form[:equivalent].each do |same|
|
27
|
+
URI(same).normalize.to_s.should == normalized
|
28
|
+
end
|
29
|
+
form[:different].each do |other|
|
30
|
+
URI(other).normalize.to_s.should_not == normalized
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,249 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require File.expand_path('../fixtures/classes', __FILE__)
|
3
|
+
|
4
|
+
describe "URI.parse" do
|
5
|
+
|
6
|
+
it "returns a URI::HTTP object when parsing an HTTP URI" do
|
7
|
+
URI.parse("http://www.example.com/").should be_kind_of(URI::HTTP)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "populates the components of a parsed URI::HTTP, setting the port to 80 by default" do
|
11
|
+
# general case
|
12
|
+
URISpec.components(URI.parse("http://user:pass@example.com/path/?query=val&q2=val2#fragment")).should == {
|
13
|
+
:scheme => "http",
|
14
|
+
:userinfo => "user:pass",
|
15
|
+
:host => "example.com",
|
16
|
+
:port => 80,
|
17
|
+
:path => "/path/",
|
18
|
+
:query => "query=val&q2=val2",
|
19
|
+
:fragment => "fragment"
|
20
|
+
}
|
21
|
+
|
22
|
+
# multiple paths
|
23
|
+
URISpec.components(URI.parse("http://a/b/c/d;p?q")).should == {
|
24
|
+
:scheme => "http",
|
25
|
+
:userinfo => nil,
|
26
|
+
:host => "a",
|
27
|
+
:port => 80,
|
28
|
+
:path => "/b/c/d;p",
|
29
|
+
:query => "q",
|
30
|
+
:fragment => nil
|
31
|
+
}
|
32
|
+
|
33
|
+
# multi-level domain
|
34
|
+
URISpec.components(URI.parse('http://www.math.uio.no/faq/compression-faq/part1.html')).should == {
|
35
|
+
:scheme => "http",
|
36
|
+
:userinfo => nil,
|
37
|
+
:host => "www.math.uio.no",
|
38
|
+
:port => 80,
|
39
|
+
:path => "/faq/compression-faq/part1.html",
|
40
|
+
:query => nil,
|
41
|
+
:fragment => nil
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
it "parses out the port number of a URI, when given" do
|
46
|
+
URI.parse("http://example.com:8080/").port.should == 8080
|
47
|
+
end
|
48
|
+
|
49
|
+
it "returns a URI::HTTPS object when parsing an HTTPS URI" do
|
50
|
+
URI.parse("https://important-intern-net.net").should be_kind_of(URI::HTTPS)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "sets the port of a parsed https URI to 443 by default" do
|
54
|
+
URI.parse("https://example.com/").port.should == 443
|
55
|
+
end
|
56
|
+
|
57
|
+
ruby_version_is "".."1.8.6" do
|
58
|
+
it "populates the components of a parsed URI::FTP object" do
|
59
|
+
# generic, empty password.
|
60
|
+
url = URI.parse("ftp://anonymous@ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.bz2;type=i")
|
61
|
+
url.should be_kind_of(URI::FTP)
|
62
|
+
URISpec.components(url).should == {
|
63
|
+
:scheme => "ftp",
|
64
|
+
:userinfo => "anonymous",
|
65
|
+
:host => "ruby-lang.org",
|
66
|
+
:port => 21,
|
67
|
+
:path => "pub/ruby/1.8/ruby-1.8.6.tar.bz2",
|
68
|
+
:typecode => "i"
|
69
|
+
}
|
70
|
+
|
71
|
+
# multidomain, no user or password
|
72
|
+
url = URI.parse('ftp://ftp.is.co.za/rfc/rfc1808.txt')
|
73
|
+
url.should be_kind_of(URI::FTP)
|
74
|
+
URISpec.components(url).should == {
|
75
|
+
:scheme => "ftp",
|
76
|
+
:userinfo => nil,
|
77
|
+
:host => "ftp.is.co.za",
|
78
|
+
:port => 21,
|
79
|
+
:path => "rfc/rfc1808.txt",
|
80
|
+
:typecode => nil
|
81
|
+
}
|
82
|
+
|
83
|
+
# empty user
|
84
|
+
url = URI.parse('ftp://:pass@localhost/')
|
85
|
+
url.should be_kind_of(URI::FTP)
|
86
|
+
URISpec.components(url).should == {
|
87
|
+
:scheme => "ftp",
|
88
|
+
:userinfo => ":pass",
|
89
|
+
:host => "localhost",
|
90
|
+
:port => 21,
|
91
|
+
:path => "/",
|
92
|
+
:typecode => nil
|
93
|
+
}
|
94
|
+
url.password.should == "pass"
|
95
|
+
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
ruby_version_is "1.8.7".."" do
|
100
|
+
it "populates the components of a parsed URI::FTP object" do
|
101
|
+
# generic, empty password.
|
102
|
+
url = URI.parse("ftp://anonymous@ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.bz2;type=i")
|
103
|
+
url.should be_kind_of(URI::FTP)
|
104
|
+
URISpec.components(url).should == {
|
105
|
+
:scheme => "ftp",
|
106
|
+
:userinfo => "anonymous",
|
107
|
+
:host => "ruby-lang.org",
|
108
|
+
:port => 21,
|
109
|
+
:path => "/pub/ruby/1.8/ruby-1.8.6.tar.bz2",
|
110
|
+
:typecode => "i"
|
111
|
+
}
|
112
|
+
|
113
|
+
# multidomain, no user or password
|
114
|
+
url = URI.parse('ftp://ftp.is.co.za/rfc/rfc1808.txt')
|
115
|
+
url.should be_kind_of(URI::FTP)
|
116
|
+
URISpec.components(url).should == {
|
117
|
+
:scheme => "ftp",
|
118
|
+
:userinfo => nil,
|
119
|
+
:host => "ftp.is.co.za",
|
120
|
+
:port => 21,
|
121
|
+
:path => "/rfc/rfc1808.txt",
|
122
|
+
:typecode => nil
|
123
|
+
}
|
124
|
+
|
125
|
+
# empty user
|
126
|
+
url = URI.parse('ftp://:pass@localhost/')
|
127
|
+
url.should be_kind_of(URI::FTP)
|
128
|
+
URISpec.components(url).should == {
|
129
|
+
:scheme => "ftp",
|
130
|
+
:userinfo => ":pass",
|
131
|
+
:host => "localhost",
|
132
|
+
:port => 21,
|
133
|
+
:path => "/",
|
134
|
+
:typecode => nil
|
135
|
+
}
|
136
|
+
url.password.should == "pass"
|
137
|
+
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
|
142
|
+
it "returns a URI::LDAP object when parsing an LDAP URI" do
|
143
|
+
#taken from http://www.faqs.org/rfcs/rfc2255.html 'cause I don't really know what an LDAP url looks like
|
144
|
+
ldap_uris = %w{ ldap:///o=University%20of%20Michigan,c=US ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen) ldap://ldap.itd.umich.edu/c=GB?objectClass?one ldap://ldap.question.com/o=Question%3f,c=US?mail ldap://ldap.netscape.com/o=Babsco,c=US??(int=%5c00%5c00%5c00%5c04) ldap:///??sub??bindname=cn=Manager%2co=Foo ldap:///??sub??!bindname=cn=Manager%2co=Foo }
|
145
|
+
ldap_uris.each do |ldap_uri|
|
146
|
+
URI.parse(ldap_uri).should be_kind_of(URI::LDAP)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
it "populates the components of a parsed URI::LDAP object" do
|
151
|
+
URISpec.components(URI.parse("ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress?scope?filter?extensions")).should == {
|
152
|
+
:scheme => "ldap",
|
153
|
+
:host => "ldap.itd.umich.edu",
|
154
|
+
:port => 389,
|
155
|
+
:dn => "o=University%20of%20Michigan,c=US",
|
156
|
+
:attributes => "postalAddress",
|
157
|
+
:scope => "scope",
|
158
|
+
:filter => "filter",
|
159
|
+
:extensions => "extensions"
|
160
|
+
}
|
161
|
+
end
|
162
|
+
|
163
|
+
it "returns a URI::MailTo object when passed a mailto URI" do
|
164
|
+
URI.parse("mailto:spam@mailinator.com").should be_kind_of(URI::MailTo)
|
165
|
+
end
|
166
|
+
|
167
|
+
it "populates the components of a parsed URI::MailTo object" do
|
168
|
+
URISpec.components(URI.parse("mailto:spam@mailinator.com?subject=Discounts%20On%20Imported%20methods!!!&body=Exciting%20offer")).should == {
|
169
|
+
:scheme => "mailto",
|
170
|
+
:to => "spam@mailinator.com",
|
171
|
+
:headers => [["subject","Discounts%20On%20Imported%20methods!!!"],
|
172
|
+
["body", "Exciting%20offer"]]
|
173
|
+
}
|
174
|
+
end
|
175
|
+
|
176
|
+
# TODO
|
177
|
+
# Test registry
|
178
|
+
it "does its best to extract components from URI::Generic objects" do
|
179
|
+
# generic
|
180
|
+
URISpec.components(URI("scheme://userinfo@host/path?query#fragment")).should == {
|
181
|
+
:scheme => "scheme",
|
182
|
+
:userinfo => "userinfo",
|
183
|
+
:host => "host",
|
184
|
+
:port => nil,
|
185
|
+
:path => "/path",
|
186
|
+
:query => "query",
|
187
|
+
:fragment => "fragment",
|
188
|
+
:registry => nil,
|
189
|
+
:opaque => nil
|
190
|
+
}
|
191
|
+
|
192
|
+
# gopher
|
193
|
+
gopher = URI.parse('gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles')
|
194
|
+
gopher.should be_kind_of(URI::Generic)
|
195
|
+
|
196
|
+
URISpec.components(gopher).should == {
|
197
|
+
:scheme => "gopher",
|
198
|
+
:userinfo => nil,
|
199
|
+
:host => "spinaltap.micro.umn.edu",
|
200
|
+
:port => nil,
|
201
|
+
:path => "/00/Weather/California/Los%20Angeles",
|
202
|
+
:query => nil,
|
203
|
+
:fragment => nil,
|
204
|
+
:registry => nil,
|
205
|
+
:opaque => nil
|
206
|
+
}
|
207
|
+
|
208
|
+
# news
|
209
|
+
news = URI.parse('news:comp.infosystems.www.servers.unix')
|
210
|
+
news.should be_kind_of(URI::Generic)
|
211
|
+
URISpec.components(news).should == {
|
212
|
+
:scheme => "news",
|
213
|
+
:userinfo => nil,
|
214
|
+
:host => nil,
|
215
|
+
:port => nil,
|
216
|
+
:path => nil,
|
217
|
+
:query => nil,
|
218
|
+
:fragment => nil,
|
219
|
+
:registry => nil,
|
220
|
+
:opaque => "comp.infosystems.www.servers.unix"
|
221
|
+
}
|
222
|
+
|
223
|
+
# telnet
|
224
|
+
telnet = URI.parse('telnet://melvyl.ucop.edu/')
|
225
|
+
telnet.should be_kind_of(URI::Generic)
|
226
|
+
URISpec.components(telnet).should == {
|
227
|
+
:scheme => "telnet",
|
228
|
+
:userinfo => nil,
|
229
|
+
:host => "melvyl.ucop.edu",
|
230
|
+
:port => nil,
|
231
|
+
:path => "/",
|
232
|
+
:query => nil,
|
233
|
+
:fragment => nil,
|
234
|
+
:registry => nil,
|
235
|
+
:opaque => nil
|
236
|
+
}
|
237
|
+
|
238
|
+
# files
|
239
|
+
file_l = URI.parse('file:///foo/bar.txt')
|
240
|
+
file_l.should be_kind_of(URI::Generic)
|
241
|
+
file = URI.parse('file:/foo/bar.txt')
|
242
|
+
file.should be_kind_of(URI::Generic)
|
243
|
+
end
|
244
|
+
|
245
|
+
it "raises errors on malformed URIs" do
|
246
|
+
lambda { URI.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
|
247
|
+
lambda { URI.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
|
248
|
+
end
|
249
|
+
end
|
@@ -0,0 +1,489 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
#an alias of URI#merge
|
5
|
+
describe "URI#+" do
|
6
|
+
it "replaces the end of the path of the URI when added to a string that looks like a relative path" do
|
7
|
+
(URI('http://foo') + 'bar').should == URI("http://foo/bar")
|
8
|
+
(URI('http://foo/baz') + 'bar').should == URI("http://foo/bar")
|
9
|
+
(URI('http://foo/baz/') + 'bar').should == URI("http://foo/baz/bar")
|
10
|
+
(URI('mailto:foo@example.com') + "#bar").should == URI("mailto:foo@example.com#bar")
|
11
|
+
end
|
12
|
+
|
13
|
+
it "replaces the entire path of the URI when added to a string that begins with a /" do
|
14
|
+
(URI('http://foo/baz/') + '/bar').should == URI("http://foo/bar")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "replaces the entire url when added to a string that looks like a full url" do
|
18
|
+
(URI.parse('http://a/b') + 'http://x/y').should == URI("http://x/y")
|
19
|
+
(URI.parse('telnet:example.com') + 'http://x/y').should == URI("http://x/y")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "canonicalizes the URI's path, removing ../'s" do
|
23
|
+
(URI.parse('http://a/b/c/../') + "./").should == URI("http://a/b/")
|
24
|
+
(URI.parse('http://a/b/c/../') + ".").should == URI("http://a/b/")
|
25
|
+
(URI.parse('http://a/b/c/') + "../").should == URI("http://a/b/")
|
26
|
+
(URI.parse('http://a/b/c/../../') + "./").should == URI("http://a/")
|
27
|
+
(URI.parse('http://a/b/c/') + "../e/").should == URI("http://a/b/e/")
|
28
|
+
(URI.parse('http://a/b/c/') + "../e/../").should == URI("http://a/b/")
|
29
|
+
(URI.parse('http://a/b/../c/') + ".").should == URI("http://a/c/")
|
30
|
+
|
31
|
+
(URI.parse('http://a/b/c/../../../') + ".").should == URI("http://a/")
|
32
|
+
end
|
33
|
+
|
34
|
+
it "doesn't conconicalize the path when adding to the empty string" do
|
35
|
+
(URI.parse('http://a/b/c/../') + "").should == URI("http://a/b/c/../")
|
36
|
+
end
|
37
|
+
|
38
|
+
it "raises a URI::BadURIError when adding two relative URIs" do
|
39
|
+
lambda {URI.parse('a/b/c') + "d"}.should raise_error(URI::BadURIError)
|
40
|
+
end
|
41
|
+
|
42
|
+
#Todo: make more BDD?
|
43
|
+
it "conforms to the merge specifications from rfc 2396" do
|
44
|
+
@url = 'http://a/b/c/d;p?q'
|
45
|
+
@base_url = URI.parse(@url)
|
46
|
+
|
47
|
+
# http://a/b/c/d;p?q
|
48
|
+
# g:h = g:h
|
49
|
+
url = @base_url.merge('g:h')
|
50
|
+
url.should be_kind_of(URI::Generic)
|
51
|
+
url.to_s.should == 'g:h'
|
52
|
+
url = @base_url.route_to('g:h')
|
53
|
+
url.should be_kind_of(URI::Generic)
|
54
|
+
url.to_s.should == 'g:h'
|
55
|
+
|
56
|
+
# http://a/b/c/d;p?q
|
57
|
+
# g = http://a/b/c/g
|
58
|
+
url = @base_url.merge('g')
|
59
|
+
url.should be_kind_of(URI::HTTP)
|
60
|
+
url.to_s.should == 'http://a/b/c/g'
|
61
|
+
url = @base_url.route_to('http://a/b/c/g')
|
62
|
+
url.should be_kind_of(URI::Generic)
|
63
|
+
url.to_s.should == 'g'
|
64
|
+
|
65
|
+
# http://a/b/c/d;p?q
|
66
|
+
# ./g = http://a/b/c/g
|
67
|
+
url = @base_url.merge('./g')
|
68
|
+
url.should be_kind_of(URI::HTTP)
|
69
|
+
url.to_s.should == 'http://a/b/c/g'
|
70
|
+
url = @base_url.route_to('http://a/b/c/g')
|
71
|
+
url.should be_kind_of(URI::Generic)
|
72
|
+
url.to_s.should_not == './g' # ok
|
73
|
+
url.to_s.should == 'g'
|
74
|
+
|
75
|
+
# http://a/b/c/d;p?q
|
76
|
+
# g/ = http://a/b/c/g/
|
77
|
+
url = @base_url.merge('g/')
|
78
|
+
url.should be_kind_of(URI::HTTP)
|
79
|
+
url.to_s.should == 'http://a/b/c/g/'
|
80
|
+
url = @base_url.route_to('http://a/b/c/g/')
|
81
|
+
url.should be_kind_of(URI::Generic)
|
82
|
+
url.to_s.should == 'g/'
|
83
|
+
|
84
|
+
# http://a/b/c/d;p?q
|
85
|
+
# /g = http://a/g
|
86
|
+
url = @base_url.merge('/g')
|
87
|
+
url.should be_kind_of(URI::HTTP)
|
88
|
+
url.to_s.should == 'http://a/g'
|
89
|
+
url = @base_url.route_to('http://a/g')
|
90
|
+
url.should be_kind_of(URI::Generic)
|
91
|
+
url.to_s.should_not == '/g' # ok
|
92
|
+
url.to_s.should == '../../g'
|
93
|
+
|
94
|
+
# http://a/b/c/d;p?q
|
95
|
+
# //g = http://g
|
96
|
+
url = @base_url.merge('//g')
|
97
|
+
url.should be_kind_of(URI::HTTP)
|
98
|
+
url.to_s.should == 'http://g'
|
99
|
+
url = @base_url.route_to('http://g')
|
100
|
+
url.should be_kind_of(URI::Generic)
|
101
|
+
url.to_s.should == '//g'
|
102
|
+
|
103
|
+
# http://a/b/c/d;p?q
|
104
|
+
# ?y = http://a/b/c/?y
|
105
|
+
url = @base_url.merge('?y')
|
106
|
+
url.should be_kind_of(URI::HTTP)
|
107
|
+
|
108
|
+
ruby_version_is "" ... "1.8.7" do
|
109
|
+
url.to_s.should == 'http://a/b/c/?y'
|
110
|
+
end
|
111
|
+
|
112
|
+
ruby_version_is "1.8.7" do
|
113
|
+
url.to_s.should == 'http://a/b/c/d;p?y'
|
114
|
+
end
|
115
|
+
|
116
|
+
url = @base_url.route_to('http://a/b/c/?y')
|
117
|
+
url.should be_kind_of(URI::Generic)
|
118
|
+
url.to_s.should == '?y'
|
119
|
+
|
120
|
+
# http://a/b/c/d;p?q
|
121
|
+
# g?y = http://a/b/c/g?y
|
122
|
+
url = @base_url.merge('g?y')
|
123
|
+
url.should be_kind_of(URI::HTTP)
|
124
|
+
url.to_s.should == 'http://a/b/c/g?y'
|
125
|
+
url = @base_url.route_to('http://a/b/c/g?y')
|
126
|
+
url.should be_kind_of(URI::Generic)
|
127
|
+
url.to_s.should == 'g?y'
|
128
|
+
|
129
|
+
# http://a/b/c/d;p?q
|
130
|
+
# #s = (current document)#s
|
131
|
+
url = @base_url.merge('#s')
|
132
|
+
url.should be_kind_of(URI::HTTP)
|
133
|
+
url.to_s.should == @base_url.to_s + '#s'
|
134
|
+
url = @base_url.route_to(@base_url.to_s + '#s')
|
135
|
+
url.should be_kind_of(URI::Generic)
|
136
|
+
url.to_s.should == '#s'
|
137
|
+
|
138
|
+
# http://a/b/c/d;p?q
|
139
|
+
# g#s = http://a/b/c/g#s
|
140
|
+
url = @base_url.merge('g#s')
|
141
|
+
url.should be_kind_of(URI::HTTP)
|
142
|
+
url.to_s.should == 'http://a/b/c/g#s'
|
143
|
+
url = @base_url.route_to('http://a/b/c/g#s')
|
144
|
+
url.should be_kind_of(URI::Generic)
|
145
|
+
url.to_s.should == 'g#s'
|
146
|
+
|
147
|
+
# http://a/b/c/d;p?q
|
148
|
+
# g?y#s = http://a/b/c/g?y#s
|
149
|
+
url = @base_url.merge('g?y#s')
|
150
|
+
url.should be_kind_of(URI::HTTP)
|
151
|
+
url.to_s.should == 'http://a/b/c/g?y#s'
|
152
|
+
url = @base_url.route_to('http://a/b/c/g?y#s')
|
153
|
+
url.should be_kind_of(URI::Generic)
|
154
|
+
url.to_s.should == 'g?y#s'
|
155
|
+
|
156
|
+
# http://a/b/c/d;p?q
|
157
|
+
# ;x = http://a/b/c/;x
|
158
|
+
url = @base_url.merge(';x')
|
159
|
+
url.should be_kind_of(URI::HTTP)
|
160
|
+
url.to_s.should == 'http://a/b/c/;x'
|
161
|
+
url = @base_url.route_to('http://a/b/c/;x')
|
162
|
+
url.should be_kind_of(URI::Generic)
|
163
|
+
url.to_s.should == ';x'
|
164
|
+
|
165
|
+
# http://a/b/c/d;p?q
|
166
|
+
# g;x = http://a/b/c/g;x
|
167
|
+
url = @base_url.merge('g;x')
|
168
|
+
url.should be_kind_of(URI::HTTP)
|
169
|
+
url.to_s.should == 'http://a/b/c/g;x'
|
170
|
+
url = @base_url.route_to('http://a/b/c/g;x')
|
171
|
+
url.should be_kind_of(URI::Generic)
|
172
|
+
url.to_s.should == 'g;x'
|
173
|
+
|
174
|
+
# http://a/b/c/d;p?q
|
175
|
+
# g;x?y#s = http://a/b/c/g;x?y#s
|
176
|
+
url = @base_url.merge('g;x?y#s')
|
177
|
+
url.should be_kind_of(URI::HTTP)
|
178
|
+
url.to_s.should == 'http://a/b/c/g;x?y#s'
|
179
|
+
url = @base_url.route_to('http://a/b/c/g;x?y#s')
|
180
|
+
url.should be_kind_of(URI::Generic)
|
181
|
+
url.to_s.should == 'g;x?y#s'
|
182
|
+
|
183
|
+
# http://a/b/c/d;p?q
|
184
|
+
# . = http://a/b/c/
|
185
|
+
url = @base_url.merge('.')
|
186
|
+
url.should be_kind_of(URI::HTTP)
|
187
|
+
url.to_s.should == 'http://a/b/c/'
|
188
|
+
url = @base_url.route_to('http://a/b/c/')
|
189
|
+
url.should be_kind_of(URI::Generic)
|
190
|
+
url.to_s.should_not == '.' # ok
|
191
|
+
url.to_s.should == './'
|
192
|
+
|
193
|
+
# http://a/b/c/d;p?q
|
194
|
+
# ./ = http://a/b/c/
|
195
|
+
url = @base_url.merge('./')
|
196
|
+
url.should be_kind_of(URI::HTTP)
|
197
|
+
url.to_s.should == 'http://a/b/c/'
|
198
|
+
url = @base_url.route_to('http://a/b/c/')
|
199
|
+
url.should be_kind_of(URI::Generic)
|
200
|
+
url.to_s.should == './'
|
201
|
+
|
202
|
+
# http://a/b/c/d;p?q
|
203
|
+
# .. = http://a/b/
|
204
|
+
url = @base_url.merge('..')
|
205
|
+
url.should be_kind_of(URI::HTTP)
|
206
|
+
url.to_s.should == 'http://a/b/'
|
207
|
+
url = @base_url.route_to('http://a/b/')
|
208
|
+
url.should be_kind_of(URI::Generic)
|
209
|
+
url.to_s.should_not == '..' # ok
|
210
|
+
url.to_s.should == '../'
|
211
|
+
|
212
|
+
# http://a/b/c/d;p?q
|
213
|
+
# ../ = http://a/b/
|
214
|
+
url = @base_url.merge('../')
|
215
|
+
url.should be_kind_of(URI::HTTP)
|
216
|
+
url.to_s.should == 'http://a/b/'
|
217
|
+
url = @base_url.route_to('http://a/b/')
|
218
|
+
url.should be_kind_of(URI::Generic)
|
219
|
+
url.to_s.should == '../'
|
220
|
+
|
221
|
+
# http://a/b/c/d;p?q
|
222
|
+
# ../g = http://a/b/g
|
223
|
+
url = @base_url.merge('../g')
|
224
|
+
url.should be_kind_of(URI::HTTP)
|
225
|
+
url.to_s.should == 'http://a/b/g'
|
226
|
+
url = @base_url.route_to('http://a/b/g')
|
227
|
+
url.should be_kind_of(URI::Generic)
|
228
|
+
url.to_s.should == '../g'
|
229
|
+
|
230
|
+
# http://a/b/c/d;p?q
|
231
|
+
# ../.. = http://a/
|
232
|
+
url = @base_url.merge('../..')
|
233
|
+
url.should be_kind_of(URI::HTTP)
|
234
|
+
url.to_s.should == 'http://a/'
|
235
|
+
url = @base_url.route_to('http://a/')
|
236
|
+
url.should be_kind_of(URI::Generic)
|
237
|
+
url.to_s.should_not == '../..' # ok
|
238
|
+
url.to_s.should == '../../'
|
239
|
+
|
240
|
+
# http://a/b/c/d;p?q
|
241
|
+
# ../../ = http://a/
|
242
|
+
url = @base_url.merge('../../')
|
243
|
+
url.should be_kind_of(URI::HTTP)
|
244
|
+
url.to_s.should == 'http://a/'
|
245
|
+
url = @base_url.route_to('http://a/')
|
246
|
+
url.should be_kind_of(URI::Generic)
|
247
|
+
url.to_s.should == '../../'
|
248
|
+
|
249
|
+
# http://a/b/c/d;p?q
|
250
|
+
# ../../g = http://a/g
|
251
|
+
url = @base_url.merge('../../g')
|
252
|
+
url.should be_kind_of(URI::HTTP)
|
253
|
+
url.to_s.should == 'http://a/g'
|
254
|
+
url = @base_url.route_to('http://a/g')
|
255
|
+
url.should be_kind_of(URI::Generic)
|
256
|
+
url.to_s.should == '../../g'
|
257
|
+
|
258
|
+
# http://a/b/c/d;p?q
|
259
|
+
# <> = (current document)
|
260
|
+
url = @base_url.merge('')
|
261
|
+
url.should be_kind_of(URI::HTTP)
|
262
|
+
url.to_s.should == 'http://a/b/c/d;p?q'
|
263
|
+
url = @base_url.route_to('http://a/b/c/d;p?q')
|
264
|
+
url.should be_kind_of(URI::Generic)
|
265
|
+
url.to_s.should == ''
|
266
|
+
|
267
|
+
# http://a/b/c/d;p?q
|
268
|
+
# /./g = http://a/./g
|
269
|
+
url = @base_url.merge('/./g')
|
270
|
+
url.should be_kind_of(URI::HTTP)
|
271
|
+
|
272
|
+
ruby_version_is "" ... "1.8.7" do
|
273
|
+
url.to_s.should == 'http://a/./g'
|
274
|
+
end
|
275
|
+
|
276
|
+
ruby_version_is "1.8.7" do
|
277
|
+
url.to_s.should == 'http://a/g'
|
278
|
+
end
|
279
|
+
|
280
|
+
url = @base_url.route_to('http://a/./g')
|
281
|
+
url.should be_kind_of(URI::Generic)
|
282
|
+
url.to_s.should == '/./g'
|
283
|
+
|
284
|
+
# http://a/b/c/d;p?q
|
285
|
+
# /../g = http://a/../g
|
286
|
+
url = @base_url.merge('/../g')
|
287
|
+
url.should be_kind_of(URI::HTTP)
|
288
|
+
|
289
|
+
ruby_version_is "" ... "1.8.7" do
|
290
|
+
url.to_s.should == 'http://a/../g'
|
291
|
+
end
|
292
|
+
|
293
|
+
ruby_version_is "1.8.7" do
|
294
|
+
url.to_s.should == 'http://a/g'
|
295
|
+
end
|
296
|
+
|
297
|
+
url = @base_url.route_to('http://a/../g')
|
298
|
+
url.should be_kind_of(URI::Generic)
|
299
|
+
url.to_s.should == '/../g'
|
300
|
+
|
301
|
+
# http://a/b/c/d;p?q
|
302
|
+
# g. = http://a/b/c/g.
|
303
|
+
url = @base_url.merge('g.')
|
304
|
+
url.should be_kind_of(URI::HTTP)
|
305
|
+
url.to_s.should == 'http://a/b/c/g.'
|
306
|
+
url = @base_url.route_to('http://a/b/c/g.')
|
307
|
+
url.should be_kind_of(URI::Generic)
|
308
|
+
url.to_s.should == 'g.'
|
309
|
+
|
310
|
+
# http://a/b/c/d;p?q
|
311
|
+
# .g = http://a/b/c/.g
|
312
|
+
url = @base_url.merge('.g')
|
313
|
+
url.should be_kind_of(URI::HTTP)
|
314
|
+
url.to_s.should == 'http://a/b/c/.g'
|
315
|
+
url = @base_url.route_to('http://a/b/c/.g')
|
316
|
+
url.should be_kind_of(URI::Generic)
|
317
|
+
url.to_s.should == '.g'
|
318
|
+
|
319
|
+
# http://a/b/c/d;p?q
|
320
|
+
# g.. = http://a/b/c/g..
|
321
|
+
url = @base_url.merge('g..')
|
322
|
+
url.should be_kind_of(URI::HTTP)
|
323
|
+
url.to_s.should == 'http://a/b/c/g..'
|
324
|
+
url = @base_url.route_to('http://a/b/c/g..')
|
325
|
+
url.should be_kind_of(URI::Generic)
|
326
|
+
url.to_s.should == 'g..'
|
327
|
+
|
328
|
+
# http://a/b/c/d;p?q
|
329
|
+
# ..g = http://a/b/c/..g
|
330
|
+
url = @base_url.merge('..g')
|
331
|
+
url.should be_kind_of(URI::HTTP)
|
332
|
+
url.to_s.should == 'http://a/b/c/..g'
|
333
|
+
url = @base_url.route_to('http://a/b/c/..g')
|
334
|
+
url.should be_kind_of(URI::Generic)
|
335
|
+
url.to_s.should == '..g'
|
336
|
+
|
337
|
+
# http://a/b/c/d;p?q
|
338
|
+
# ../../../g = http://a/../g
|
339
|
+
url = @base_url.merge('../../../g')
|
340
|
+
url.should be_kind_of(URI::HTTP)
|
341
|
+
|
342
|
+
ruby_version_is "" ... "1.8.7" do
|
343
|
+
url.to_s.should == 'http://a/../g'
|
344
|
+
end
|
345
|
+
|
346
|
+
ruby_version_is "1.8.7" do
|
347
|
+
url.to_s.should == 'http://a/g'
|
348
|
+
end
|
349
|
+
|
350
|
+
url = @base_url.route_to('http://a/../g')
|
351
|
+
url.should be_kind_of(URI::Generic)
|
352
|
+
url.to_s.should_not == '../../../g' # ok? yes, it confuses you
|
353
|
+
url.to_s.should == '/../g' # and it is clearly
|
354
|
+
|
355
|
+
# http://a/b/c/d;p?q
|
356
|
+
# ../../../../g = http://a/../../g
|
357
|
+
url = @base_url.merge('../../../../g')
|
358
|
+
url.should be_kind_of(URI::HTTP)
|
359
|
+
|
360
|
+
ruby_version_is "" ... "1.8.7" do
|
361
|
+
url.to_s.should == 'http://a/../../g'
|
362
|
+
end
|
363
|
+
|
364
|
+
ruby_version_is "1.8.7" do
|
365
|
+
url.to_s.should == 'http://a/g'
|
366
|
+
end
|
367
|
+
|
368
|
+
url = @base_url.route_to('http://a/../../g')
|
369
|
+
url.should be_kind_of(URI::Generic)
|
370
|
+
url.to_s.should_not == '../../../../g' # ok? yes, it confuses you
|
371
|
+
url.to_s.should == '/../../g' # and it is clearly
|
372
|
+
|
373
|
+
# http://a/b/c/d;p?q
|
374
|
+
# ./../g = http://a/b/g
|
375
|
+
url = @base_url.merge('./../g')
|
376
|
+
url.should be_kind_of(URI::HTTP)
|
377
|
+
url.to_s.should == 'http://a/b/g'
|
378
|
+
url = @base_url.route_to('http://a/b/g')
|
379
|
+
url.should be_kind_of(URI::Generic)
|
380
|
+
url.to_s.should_not == './../g' # ok
|
381
|
+
url.to_s.should == '../g'
|
382
|
+
|
383
|
+
# http://a/b/c/d;p?q
|
384
|
+
# ./g/. = http://a/b/c/g/
|
385
|
+
url = @base_url.merge('./g/.')
|
386
|
+
url.should be_kind_of(URI::HTTP)
|
387
|
+
url.to_s.should == 'http://a/b/c/g/'
|
388
|
+
url = @base_url.route_to('http://a/b/c/g/')
|
389
|
+
url.should be_kind_of(URI::Generic)
|
390
|
+
url.to_s.should_not == './g/.' # ok
|
391
|
+
url.to_s.should == 'g/'
|
392
|
+
|
393
|
+
# http://a/b/c/d;p?q
|
394
|
+
# g/./h = http://a/b/c/g/h
|
395
|
+
url = @base_url.merge('g/./h')
|
396
|
+
url.should be_kind_of(URI::HTTP)
|
397
|
+
url.to_s.should == 'http://a/b/c/g/h'
|
398
|
+
url = @base_url.route_to('http://a/b/c/g/h')
|
399
|
+
url.should be_kind_of(URI::Generic)
|
400
|
+
url.to_s.should_not == 'g/./h' # ok
|
401
|
+
url.to_s.should == 'g/h'
|
402
|
+
|
403
|
+
# http://a/b/c/d;p?q
|
404
|
+
# g/../h = http://a/b/c/h
|
405
|
+
url = @base_url.merge('g/../h')
|
406
|
+
url.should be_kind_of(URI::HTTP)
|
407
|
+
url.to_s.should == 'http://a/b/c/h'
|
408
|
+
url = @base_url.route_to('http://a/b/c/h')
|
409
|
+
url.should be_kind_of(URI::Generic)
|
410
|
+
url.to_s.should_not == 'g/../h' # ok
|
411
|
+
url.to_s.should == 'h'
|
412
|
+
|
413
|
+
# http://a/b/c/d;p?q
|
414
|
+
# g;x=1/./y = http://a/b/c/g;x=1/y
|
415
|
+
url = @base_url.merge('g;x=1/./y')
|
416
|
+
url.should be_kind_of(URI::HTTP)
|
417
|
+
url.to_s.should == 'http://a/b/c/g;x=1/y'
|
418
|
+
url = @base_url.route_to('http://a/b/c/g;x=1/y')
|
419
|
+
url.should be_kind_of(URI::Generic)
|
420
|
+
url.to_s.should_not == 'g;x=1/./y' # ok
|
421
|
+
url.to_s.should == 'g;x=1/y'
|
422
|
+
|
423
|
+
# http://a/b/c/d;p?q
|
424
|
+
# g;x=1/../y = http://a/b/c/y
|
425
|
+
url = @base_url.merge('g;x=1/../y')
|
426
|
+
url.should be_kind_of(URI::HTTP)
|
427
|
+
url.to_s.should == 'http://a/b/c/y'
|
428
|
+
url = @base_url.route_to('http://a/b/c/y')
|
429
|
+
url.should be_kind_of(URI::Generic)
|
430
|
+
url.to_s.should_not == 'g;x=1/../y' # ok
|
431
|
+
url.to_s.should == 'y'
|
432
|
+
|
433
|
+
# http://a/b/c/d;p?q
|
434
|
+
# g?y/./x = http://a/b/c/g?y/./x
|
435
|
+
url = @base_url.merge('g?y/./x')
|
436
|
+
url.should be_kind_of(URI::HTTP)
|
437
|
+
url.to_s.should == 'http://a/b/c/g?y/./x'
|
438
|
+
url = @base_url.route_to('http://a/b/c/g?y/./x')
|
439
|
+
url.should be_kind_of(URI::Generic)
|
440
|
+
url.to_s.should == 'g?y/./x'
|
441
|
+
|
442
|
+
# http://a/b/c/d;p?q
|
443
|
+
# g?y/../x = http://a/b/c/g?y/../x
|
444
|
+
url = @base_url.merge('g?y/../x')
|
445
|
+
url.should be_kind_of(URI::HTTP)
|
446
|
+
url.to_s.should == 'http://a/b/c/g?y/../x'
|
447
|
+
url = @base_url.route_to('http://a/b/c/g?y/../x')
|
448
|
+
url.should be_kind_of(URI::Generic)
|
449
|
+
url.to_s.should == 'g?y/../x'
|
450
|
+
|
451
|
+
# http://a/b/c/d;p?q
|
452
|
+
# g#s/./x = http://a/b/c/g#s/./x
|
453
|
+
url = @base_url.merge('g#s/./x')
|
454
|
+
url.should be_kind_of(URI::HTTP)
|
455
|
+
url.to_s.should == 'http://a/b/c/g#s/./x'
|
456
|
+
url = @base_url.route_to('http://a/b/c/g#s/./x')
|
457
|
+
url.should be_kind_of(URI::Generic)
|
458
|
+
url.to_s.should == 'g#s/./x'
|
459
|
+
|
460
|
+
# http://a/b/c/d;p?q
|
461
|
+
# g#s/../x = http://a/b/c/g#s/../x
|
462
|
+
url = @base_url.merge('g#s/../x')
|
463
|
+
url.should be_kind_of(URI::HTTP)
|
464
|
+
url.to_s.should == 'http://a/b/c/g#s/../x'
|
465
|
+
url = @base_url.route_to('http://a/b/c/g#s/../x')
|
466
|
+
url.should be_kind_of(URI::Generic)
|
467
|
+
url.to_s.should == 'g#s/../x'
|
468
|
+
|
469
|
+
# http://a/b/c/d;p?q
|
470
|
+
# http:g = http:g ; for validating parsers
|
471
|
+
# | http://a/b/c/g ; for backwards compatibility
|
472
|
+
url = @base_url.merge('http:g')
|
473
|
+
url.should be_kind_of(URI::HTTP)
|
474
|
+
url.to_s.should == 'http:g'
|
475
|
+
url = @base_url.route_to('http:g')
|
476
|
+
url.should be_kind_of(URI::Generic)
|
477
|
+
url.to_s.should == 'http:g'
|
478
|
+
end
|
479
|
+
end
|
480
|
+
|
481
|
+
#TODO: incorporate these tests:
|
482
|
+
#
|
483
|
+
# u = URI.parse('http://foo/bar/baz')
|
484
|
+
# assert_equal(nil, u.merge!(""))
|
485
|
+
# assert_equal(nil, u.merge!(u))
|
486
|
+
# assert(nil != u.merge!("."))
|
487
|
+
# assert_equal('http://foo/bar/', u.to_s)
|
488
|
+
# assert(nil != u.merge!("../baz"))
|
489
|
+
# assert_equal('http://foo/baz', u.to_s)
|