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,18 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
#I'm more or less ok with these limited tests, as the more extensive extract tests
|
5
|
+
#use URI.regexp
|
6
|
+
describe "URI.regexp" do
|
7
|
+
it "behaves according to the MatzRuby tests" do
|
8
|
+
URI.regexp.should == URI.regexp
|
9
|
+
'x http:// x'.slice(URI.regexp).should == 'http://'
|
10
|
+
'x http:// x'.slice(URI.regexp(['http'])).should == 'http://'
|
11
|
+
'x http:// x ftp://'.slice(URI.regexp(['http'])).should == 'http://'
|
12
|
+
'http://'.slice(URI.regexp([])).should == nil
|
13
|
+
''.slice(URI.regexp).should == nil
|
14
|
+
'xxxx'.slice(URI.regexp).should == nil
|
15
|
+
':'.slice(URI.regexp).should == nil
|
16
|
+
'From:'.slice(URI.regexp).should == 'From:'
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
describe "URI#route_from" do
|
5
|
+
|
6
|
+
#this could be split out a good bit better
|
7
|
+
it "gives the minimal difference between the current URI and the target" do
|
8
|
+
URI("http://example.com/a.html").route_from('http://example.com/a.html').to_s.should == ""
|
9
|
+
URI("http://example.com/a.html").route_from('http://example.com/b.html').to_s.should == "a.html"
|
10
|
+
URI("http://example.com/a/").route_from('http://example.com/b/').to_s.should == "../a/"
|
11
|
+
URI("http://example.com/b/").route_from('http://example.com/a/c').to_s.should == "../b/"
|
12
|
+
URI("http://example.com/b/").route_from('http://example.com/a/b/').to_s.should == "../../b/"
|
13
|
+
URI("http://example.com/b/").route_from('http://EXAMPLE.cOm/a/b/').to_s.should == "../../b/"
|
14
|
+
URI("http://example.net/b/").route_from('http://example.com/a/b/').to_s.should == "//example.net/b/"
|
15
|
+
URI("mailto:foo@example.com#bar").route_from('mailto:foo@example.com').to_s.should == "#bar"
|
16
|
+
end
|
17
|
+
|
18
|
+
ruby_bug "redmine:3506", "1.9.2" do
|
19
|
+
it "accepts a string-like argument" do
|
20
|
+
str = mock('string-like')
|
21
|
+
str.should_receive(:to_str).and_return("http://example.com/b.html")
|
22
|
+
URI("http://example.com/a.html").route_from(str).to_s.should == "a.html"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
describe "URI#route_to" do
|
5
|
+
|
6
|
+
#this could be split out a good bit better
|
7
|
+
it "gives the minimal difference between the current URI and the target" do
|
8
|
+
URI("http://example.com/a.html").route_to('http://example.com/a.html').to_s.should == ""
|
9
|
+
URI("http://example.com/a.html").route_to('http://example.com/b.html').to_s.should == "b.html"
|
10
|
+
URI("http://example.com/a/").route_to('http://example.com/b/').to_s.should == "../b/"
|
11
|
+
URI("http://example.com/a/c").route_to('http://example.com/b/').to_s.should == "../b/"
|
12
|
+
URI("http://example.com/a/b/").route_to('http://example.com/b/').to_s.should == "../../b/"
|
13
|
+
URI("http://example.com/a/b/").route_to('http://EXAMPLE.cOm/b/').to_s.should == "../../b/"
|
14
|
+
URI("http://example.com/a/b/").route_to('http://example.net/b/').to_s.should == "//example.net/b/"
|
15
|
+
URI("mailto:foo@example.com").route_to('mailto:foo@example.com#bar').to_s.should == "#bar"
|
16
|
+
|
17
|
+
#this was a little surprising to me
|
18
|
+
URI("mailto:foo@example.com#bar").route_to('mailto:foo@example.com').to_s.should == ""
|
19
|
+
end
|
20
|
+
|
21
|
+
ruby_bug "redmine:3506", "1.9.2" do
|
22
|
+
it "accepts a string-like argument" do
|
23
|
+
str = mock('string-like')
|
24
|
+
str.should_receive(:to_str).and_return("http://example.com/b.html")
|
25
|
+
URI("http://example.com/a.html").route_to(str).to_s.should == "b.html"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
describe "URI#select" do
|
5
|
+
it "takes any number of component names as symbols, and returns an array of those components" do
|
6
|
+
URI("http://host:8080/path/").select.should == []
|
7
|
+
URI("http://host:8080/path/").select(:scheme,:host,:port,:path).should == [
|
8
|
+
"http","host",8080,"/path/"]
|
9
|
+
end
|
10
|
+
|
11
|
+
it "returns nil for any valid component that isn't set and doesn't have a default" do
|
12
|
+
uri = URI("http://host")
|
13
|
+
uri.select(:userinfo, :query, :fragment).should == [nil] * 3
|
14
|
+
uri.select(:port, :path).should == [80, '']
|
15
|
+
end
|
16
|
+
|
17
|
+
it "raises an ArgumentError if a component is requested that isn't valid under the given scheme" do
|
18
|
+
bad_selects = [
|
19
|
+
lambda {URI("mailto:spam@mailinator.com").select(:path)},
|
20
|
+
lambda {URI("http://blog.blag.web").select(:typecode)},
|
21
|
+
].each do |select_lambda|
|
22
|
+
select_lambda.should raise_error(ArgumentError)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "raises an ArgumentError if given strings rather than symbols" do
|
27
|
+
lambda {
|
28
|
+
URI("http://host:8080/path/").select("scheme","host","port",'path')
|
29
|
+
}.should raise_error(ArgumentError)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
#TODO: make this more BDD
|
5
|
+
describe 'URI#select' do
|
6
|
+
it "conforms to the MatzRuby tests" do
|
7
|
+
uri = URI.parse('http://foo:bar@baz')
|
8
|
+
(uri.user = 'oof').should == 'oof'
|
9
|
+
uri.to_s.should == 'http://oof:bar@baz'
|
10
|
+
(uri.password = 'rab').should == 'rab'
|
11
|
+
uri.to_s.should == 'http://oof:rab@baz'
|
12
|
+
(uri.userinfo = 'foo').should == 'foo'
|
13
|
+
uri.to_s.should == 'http://foo:rab@baz'
|
14
|
+
(uri.userinfo = ['foo', 'bar']).should == ['foo', 'bar']
|
15
|
+
uri.to_s.should == 'http://foo:bar@baz'
|
16
|
+
(uri.userinfo = ['foo']).should == ['foo']
|
17
|
+
uri.to_s.should == 'http://foo:bar@baz'
|
18
|
+
(uri.host = 'zab').should == 'zab'
|
19
|
+
uri.to_s.should == 'http://foo:bar@zab'
|
20
|
+
(uri.port = 8080).should == 8080
|
21
|
+
uri.to_s.should == 'http://foo:bar@zab:8080'
|
22
|
+
(uri.path = '/').should == '/'
|
23
|
+
uri.to_s.should == 'http://foo:bar@zab:8080/'
|
24
|
+
(uri.query = 'a=1').should == 'a=1'
|
25
|
+
uri.to_s.should == 'http://foo:bar@zab:8080/?a=1'
|
26
|
+
(uri.fragment = 'b123').should == 'b123'
|
27
|
+
uri.to_s.should == 'http://foo:bar@zab:8080/?a=1#b123'
|
28
|
+
|
29
|
+
uri = URI.parse('http://example.com')
|
30
|
+
lambda { uri.password = 'bar' }.should raise_error(URI::InvalidURIError)
|
31
|
+
uri.userinfo = 'foo:bar'
|
32
|
+
uri.to_s.should == 'http://foo:bar@example.com'
|
33
|
+
lambda { uri.registry = 'bar' }.should raise_error(URI::InvalidURIError)
|
34
|
+
lambda { uri.opaque = 'bar' }.should raise_error(URI::InvalidURIError)
|
35
|
+
|
36
|
+
uri = URI.parse('mailto:foo@example.com')
|
37
|
+
lambda { uri.user = 'bar' }.should raise_error(URI::InvalidURIError)
|
38
|
+
lambda { uri.password = 'bar' }.should raise_error(URI::InvalidURIError)
|
39
|
+
lambda { uri.userinfo = ['bar', 'baz'] }.should raise_error(URI::InvalidURIError)
|
40
|
+
lambda { uri.host = 'bar' }.should raise_error(URI::InvalidURIError)
|
41
|
+
lambda { uri.port = 'bar' }.should raise_error(URI::InvalidURIError)
|
42
|
+
lambda { uri.path = 'bar' }.should raise_error(URI::InvalidURIError)
|
43
|
+
lambda { uri.query = 'bar' }.should raise_error(URI::InvalidURIError)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
describe :uri_eql, :shared => true do
|
2
|
+
it "returns false if the normalized forms are different" do
|
3
|
+
URISpec::NORMALIZED_FORMS.each do |form|
|
4
|
+
normal_uri = URI(form[:normalized])
|
5
|
+
form[:different].each do |other|
|
6
|
+
URI(other).send(@method, normal_uri).should be_false
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe :uri_eql_against_other_types, :shared => true do
|
13
|
+
it "returns false for when compared to non-uri objects" do
|
14
|
+
URI("http://example.com/").send(@method, "http://example.com/").should be_false
|
15
|
+
URI("http://example.com/").send(@method, nil).should be_false
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
#the testing is light here as this is an alias for URI.parse
|
5
|
+
|
6
|
+
#we're just testing that the method ends up in the right place
|
7
|
+
describe "the URI method" do
|
8
|
+
it "parses a given URI, returning a URI object" do
|
9
|
+
result = URI.parse("http://ruby-lang.org")
|
10
|
+
URI("http://ruby-lang.org").should == result
|
11
|
+
Kernel::URI("http://ruby-lang.org").should == result
|
12
|
+
end
|
13
|
+
|
14
|
+
it "converts its argument with to_str" do
|
15
|
+
str = mock('string-like')
|
16
|
+
str.should_receive(:to_str).and_return("http://ruby-lang.org")
|
17
|
+
URI(str).should == URI.parse("http://ruby-lang.org")
|
18
|
+
end
|
19
|
+
|
20
|
+
ruby_bug "redmine:3505", "1.9.2" do
|
21
|
+
it "returns the argument if it is a URI object" do
|
22
|
+
result = URI.parse("http://ruby-lang.org")
|
23
|
+
URI(result).should equal(result)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
#apparently this was a concern? imported from MRI tests
|
28
|
+
it "does not add a URI method to Object instances" do
|
29
|
+
lambda {Object.new.URI("http://ruby-lang.org/")}.should raise_error(NoMethodError)
|
30
|
+
end
|
31
|
+
end
|
@@ -12,9 +12,9 @@ iphone:
|
|
12
12
|
entitlements: ""
|
13
13
|
codesignidentity: ""
|
14
14
|
configuration: Release
|
15
|
-
extensions: ["
|
15
|
+
extensions: ["digest-sha1"]
|
16
16
|
|
17
17
|
android:
|
18
18
|
version: 2.3.3
|
19
19
|
|
20
|
-
extensions: ["mspec", "fileutils", "digest", "digest-md5", "test-libs", "set", "thread"]
|
20
|
+
extensions: ["mspec", "fileutils", "digest", "digest-md5", "test-libs", "set", "thread", "timeout", "uri", "net-http", "fcntl", "rexml" ]
|
@@ -0,0 +1,328 @@
|
|
1
|
+
require 'test/unit/testcase'
|
2
|
+
require 'test/unit/autorunner'
|
3
|
+
|
4
|
+
module Test # :nodoc:
|
5
|
+
#
|
6
|
+
# = Test::Unit - Ruby Unit Testing Framework
|
7
|
+
#
|
8
|
+
# == Introduction
|
9
|
+
#
|
10
|
+
# Unit testing is making waves all over the place, largely due to the
|
11
|
+
# fact that it is a core practice of XP. While XP is great, unit testing
|
12
|
+
# has been around for a long time and has always been a good idea. One
|
13
|
+
# of the keys to good unit testing, though, is not just writing tests,
|
14
|
+
# but having tests. What's the difference? Well, if you just _write_ a
|
15
|
+
# test and throw it away, you have no guarantee that something won't
|
16
|
+
# change later which breaks your code. If, on the other hand, you _have_
|
17
|
+
# tests (obviously you have to write them first), and run them as often
|
18
|
+
# as possible, you slowly build up a wall of things that cannot break
|
19
|
+
# without you immediately knowing about it. This is when unit testing
|
20
|
+
# hits its peak usefulness.
|
21
|
+
#
|
22
|
+
# Enter Test::Unit, a framework for unit testing in Ruby, helping you to
|
23
|
+
# design, debug and evaluate your code by making it easy to write and
|
24
|
+
# have tests for it.
|
25
|
+
#
|
26
|
+
#
|
27
|
+
# == Notes
|
28
|
+
#
|
29
|
+
# Test::Unit has grown out of and superceded Lapidary.
|
30
|
+
#
|
31
|
+
#
|
32
|
+
# == Feedback
|
33
|
+
#
|
34
|
+
# I like (and do my best to practice) XP, so I value early releases,
|
35
|
+
# user feedback, and clean, simple, expressive code. There is always
|
36
|
+
# room for improvement in everything I do, and Test::Unit is no
|
37
|
+
# exception. Please, let me know what you think of Test::Unit as it
|
38
|
+
# stands, and what you'd like to see expanded/changed/improved/etc. If
|
39
|
+
# you find a bug, let me know ASAP; one good way to let me know what the
|
40
|
+
# bug is is to submit a new test that catches it :-) Also, I'd love to
|
41
|
+
# hear about any successes you have with Test::Unit, and any
|
42
|
+
# documentation you might add will be greatly appreciated. My contact
|
43
|
+
# info is below.
|
44
|
+
#
|
45
|
+
#
|
46
|
+
# == Contact Information
|
47
|
+
#
|
48
|
+
# A lot of discussion happens about Ruby in general on the ruby-talk
|
49
|
+
# mailing list (http://www.ruby-lang.org/en/ml.html), and you can ask
|
50
|
+
# any questions you might have there. I monitor the list, as do many
|
51
|
+
# other helpful Rubyists, and you're sure to get a quick answer. Of
|
52
|
+
# course, you're also welcome to email me (Nathaniel Talbott) directly
|
53
|
+
# at mailto:testunit@talbott.ws, and I'll do my best to help you out.
|
54
|
+
#
|
55
|
+
#
|
56
|
+
# == Credits
|
57
|
+
#
|
58
|
+
# I'd like to thank...
|
59
|
+
#
|
60
|
+
# Matz, for a great language!
|
61
|
+
#
|
62
|
+
# Masaki Suketa, for his work on RubyUnit, which filled a vital need in
|
63
|
+
# the Ruby world for a very long time. I'm also grateful for his help in
|
64
|
+
# polishing Test::Unit and getting the RubyUnit compatibility layer
|
65
|
+
# right. His graciousness in allowing Test::Unit to supercede RubyUnit
|
66
|
+
# continues to be a challenge to me to be more willing to defer my own
|
67
|
+
# rights.
|
68
|
+
#
|
69
|
+
# Ken McKinlay, for his interest and work on unit testing, and for his
|
70
|
+
# willingness to dialog about it. He was also a great help in pointing
|
71
|
+
# out some of the holes in the RubyUnit compatibility layer.
|
72
|
+
#
|
73
|
+
# Dave Thomas, for the original idea that led to the extremely simple
|
74
|
+
# "require 'test/unit'", plus his code to improve it even more by
|
75
|
+
# allowing the selection of tests from the command-line. Also, without
|
76
|
+
# RDoc, the documentation for Test::Unit would stink a lot more than it
|
77
|
+
# does now.
|
78
|
+
#
|
79
|
+
# Everyone who's helped out with bug reports, feature ideas,
|
80
|
+
# encouragement to continue, etc. It's a real privilege to be a part of
|
81
|
+
# the Ruby community.
|
82
|
+
#
|
83
|
+
# The guys at RoleModel Software, for putting up with me repeating, "But
|
84
|
+
# this would be so much easier in Ruby!" whenever we're coding in Java.
|
85
|
+
#
|
86
|
+
# My Creator, for giving me life, and giving it more abundantly.
|
87
|
+
#
|
88
|
+
#
|
89
|
+
# == License
|
90
|
+
#
|
91
|
+
# Test::Unit is copyright (c) 2000-2003 Nathaniel Talbott. It is free
|
92
|
+
# software, and is distributed under the Ruby license. See the COPYING
|
93
|
+
# file.
|
94
|
+
#
|
95
|
+
# Exception: lib/test/unit/diff.rb is copyright (c)
|
96
|
+
# 2008-2010 Kouhei Sutou and 2001-2008 Python Software
|
97
|
+
# Foundation. It is free software, and is distributed
|
98
|
+
# under the Ruby license and/or the PSF license. See the
|
99
|
+
# COPYING file and PSFL file.
|
100
|
+
#
|
101
|
+
# == Warranty
|
102
|
+
#
|
103
|
+
# This software is provided "as is" and without any express or
|
104
|
+
# implied warranties, including, without limitation, the implied
|
105
|
+
# warranties of merchantibility and fitness for a particular
|
106
|
+
# purpose.
|
107
|
+
#
|
108
|
+
#
|
109
|
+
# == Author
|
110
|
+
#
|
111
|
+
# Nathaniel Talbott.
|
112
|
+
# Copyright (c) 2000-2003, Nathaniel Talbott
|
113
|
+
#
|
114
|
+
# ----
|
115
|
+
#
|
116
|
+
# = Usage
|
117
|
+
#
|
118
|
+
# The general idea behind unit testing is that you write a _test_
|
119
|
+
# _method_ that makes certain _assertions_ about your code, working
|
120
|
+
# against a _test_ _fixture_. A bunch of these _test_ _methods_ are
|
121
|
+
# bundled up into a _test_ _suite_ and can be run any time the
|
122
|
+
# developer wants. The results of a run are gathered in a _test_
|
123
|
+
# _result_ and displayed to the user through some UI. So, lets break
|
124
|
+
# this down and see how Test::Unit provides each of these necessary
|
125
|
+
# pieces.
|
126
|
+
#
|
127
|
+
#
|
128
|
+
# == Assertions
|
129
|
+
#
|
130
|
+
# These are the heart of the framework. Think of an assertion as a
|
131
|
+
# statement of expected outcome, i.e. "I assert that x should be equal
|
132
|
+
# to y". If, when the assertion is executed, it turns out to be
|
133
|
+
# correct, nothing happens, and life is good. If, on the other hand,
|
134
|
+
# your assertion turns out to be false, an error is propagated with
|
135
|
+
# pertinent information so that you can go back and make your
|
136
|
+
# assertion succeed, and, once again, life is good. For an explanation
|
137
|
+
# of the current assertions, see Test::Unit::Assertions.
|
138
|
+
#
|
139
|
+
#
|
140
|
+
# == Test Method & Test Fixture
|
141
|
+
#
|
142
|
+
# Obviously, these assertions have to be called within a context that
|
143
|
+
# knows about them and can do something meaningful with their
|
144
|
+
# pass/fail value. Also, it's handy to collect a bunch of related
|
145
|
+
# tests, each test represented by a method, into a common test class
|
146
|
+
# that knows how to run them. The tests will be in a separate class
|
147
|
+
# from the code they're testing for a couple of reasons. First of all,
|
148
|
+
# it allows your code to stay uncluttered with test code, making it
|
149
|
+
# easier to maintain. Second, it allows the tests to be stripped out
|
150
|
+
# for deployment, since they're really there for you, the developer,
|
151
|
+
# and your users don't need them. Third, and most importantly, it
|
152
|
+
# allows you to set up a common test fixture for your tests to run
|
153
|
+
# against.
|
154
|
+
#
|
155
|
+
# What's a test fixture? Well, tests do not live in a vacuum; rather,
|
156
|
+
# they're run against the code they are testing. Often, a collection
|
157
|
+
# of tests will run against a common set of data, also called a
|
158
|
+
# fixture. If they're all bundled into the same test class, they can
|
159
|
+
# all share the setting up and tearing down of that data, eliminating
|
160
|
+
# unnecessary duplication and making it much easier to add related
|
161
|
+
# tests.
|
162
|
+
#
|
163
|
+
# Test::Unit::TestCase wraps up a collection of test methods together
|
164
|
+
# and allows you to easily set up and tear down the same test fixture
|
165
|
+
# for each test. This is done by overriding #setup and/or #teardown,
|
166
|
+
# which will be called before and after each test method that is
|
167
|
+
# run. The TestCase also knows how to collect the results of your
|
168
|
+
# assertions into a Test::Unit::TestResult, which can then be reported
|
169
|
+
# back to you... but I'm getting ahead of myself. To write a test,
|
170
|
+
# follow these steps:
|
171
|
+
#
|
172
|
+
# * Make sure Test::Unit is in your library path.
|
173
|
+
# * require 'test/unit' in your test script.
|
174
|
+
# * Create a class that subclasses Test::Unit::TestCase.
|
175
|
+
# * Add a method that begins with "test" to your class.
|
176
|
+
# * Make assertions in your test method.
|
177
|
+
# * Optionally define #setup and/or #teardown to set up and/or tear
|
178
|
+
# down your common test fixture.
|
179
|
+
# * You can now run your test as you would any other Ruby
|
180
|
+
# script... try it and see!
|
181
|
+
#
|
182
|
+
# A really simple test might look like this (#setup and #teardown are
|
183
|
+
# commented out to indicate that they are completely optional):
|
184
|
+
#
|
185
|
+
# require 'test/unit'
|
186
|
+
#
|
187
|
+
# class MyTest < Test::Unit::TestCase
|
188
|
+
# # def setup
|
189
|
+
# # end
|
190
|
+
#
|
191
|
+
# # def teardown
|
192
|
+
# # end
|
193
|
+
#
|
194
|
+
# def test_fail
|
195
|
+
# assert(false, 'Assertion was false.')
|
196
|
+
# end
|
197
|
+
# end
|
198
|
+
#
|
199
|
+
#
|
200
|
+
# == Test Runners
|
201
|
+
#
|
202
|
+
# So, now you have this great test class, but you still
|
203
|
+
# need a way to run it and view any failures that occur
|
204
|
+
# during the run. There are some test runner; console test
|
205
|
+
# runner, GTK+ test runner and so on. The console test
|
206
|
+
# runner is automatically invoked for you if you require
|
207
|
+
# 'test/unit' and simply run the file. To use another
|
208
|
+
# runner simply set default test runner ID to
|
209
|
+
# Test::Unit::AutoRunner:
|
210
|
+
#
|
211
|
+
# require 'test/unit'
|
212
|
+
# Test::Unit::AutoRunner.default_runner = "gtk2"
|
213
|
+
#
|
214
|
+
# == Test Suite
|
215
|
+
#
|
216
|
+
# As more and more unit tests accumulate for a given project, it
|
217
|
+
# becomes a real drag running them one at a time, and it also
|
218
|
+
# introduces the potential to overlook a failing test because you
|
219
|
+
# forget to run it. Suddenly it becomes very handy that the
|
220
|
+
# TestRunners can take any object that returns a Test::Unit::TestSuite
|
221
|
+
# in response to a suite method. The TestSuite can, in turn, contain
|
222
|
+
# other TestSuites or individual tests (typically created by a
|
223
|
+
# TestCase). In other words, you can easily wrap up a group of
|
224
|
+
# TestCases and TestSuites.
|
225
|
+
#
|
226
|
+
# Test::Unit does a little bit more for you, by wrapping
|
227
|
+
# these up automatically when you require
|
228
|
+
# 'test/unit'. What does this mean? It means you could
|
229
|
+
# write the above test case like this instead:
|
230
|
+
#
|
231
|
+
# require 'test/unit'
|
232
|
+
# require 'test_myfirsttests'
|
233
|
+
# require 'test_moretestsbyme'
|
234
|
+
# require 'test_anothersetoftests'
|
235
|
+
#
|
236
|
+
# Test::Unit is smart enough to find all the test cases existing in
|
237
|
+
# the ObjectSpace and wrap them up into a suite for you. It then runs
|
238
|
+
# the dynamic suite using the console TestRunner.
|
239
|
+
#
|
240
|
+
#
|
241
|
+
# == Configuration file
|
242
|
+
#
|
243
|
+
# Test::Unit reads 'test-unit.yml' in the current working
|
244
|
+
# directory as Test::Unit's configuration file. It can
|
245
|
+
# contain the following configurations:
|
246
|
+
#
|
247
|
+
# * color scheme definitions
|
248
|
+
# * test runner to be used
|
249
|
+
# * test runner options
|
250
|
+
# * test collector to be used
|
251
|
+
#
|
252
|
+
# Except color scheme definitions, all of them are
|
253
|
+
# specified by command line option.
|
254
|
+
#
|
255
|
+
# Here are sample color scheme definitions:
|
256
|
+
#
|
257
|
+
# color_schemes:
|
258
|
+
# inverted:
|
259
|
+
# success:
|
260
|
+
# name: red
|
261
|
+
# bold: true
|
262
|
+
# failure:
|
263
|
+
# name: green
|
264
|
+
# bold: true
|
265
|
+
# other_scheme:
|
266
|
+
# ...
|
267
|
+
#
|
268
|
+
# Here are the syntax of color scheme definitions:
|
269
|
+
#
|
270
|
+
# color_schemes:
|
271
|
+
# SCHEME_NAME:
|
272
|
+
# EVENT_NAME:
|
273
|
+
# name: COLOR_NAME
|
274
|
+
# intensity: BOOLEAN
|
275
|
+
# bold: BOOLEAN
|
276
|
+
# italic: BOOLEAN
|
277
|
+
# underline: BOOLEAN
|
278
|
+
# ...
|
279
|
+
# ...
|
280
|
+
#
|
281
|
+
# SCHEME_NAME:: the name of the color scheme
|
282
|
+
# EVENT_NAME:: one of [success, failure, pending,
|
283
|
+
# omission, notification, error]
|
284
|
+
# COLOR_NAME:: one of [black, red, green, yellow, blue,
|
285
|
+
# magenta, cyan, white]
|
286
|
+
# BOOLEAN:: true or false
|
287
|
+
#
|
288
|
+
# You can use the above 'inverted' color scheme with the
|
289
|
+
# following configuration:
|
290
|
+
#
|
291
|
+
# runner: console
|
292
|
+
# console_options:
|
293
|
+
# color_scheme: inverted
|
294
|
+
# color_schemes:
|
295
|
+
# inverted:
|
296
|
+
# success:
|
297
|
+
# name: red
|
298
|
+
# bold: true
|
299
|
+
# failure:
|
300
|
+
# name: green
|
301
|
+
# bold: true
|
302
|
+
#
|
303
|
+
# == Questions?
|
304
|
+
#
|
305
|
+
# I'd really like to get feedback from all levels of Ruby
|
306
|
+
# practitioners about typos, grammatical errors, unclear statements,
|
307
|
+
# missing points, etc., in this document (or any other).
|
308
|
+
#
|
309
|
+
|
310
|
+
module Unit
|
311
|
+
# Set true when Test::Unit has run. If set to true Test::Unit
|
312
|
+
# will not automatically run at exit.
|
313
|
+
def self.run=(flag)
|
314
|
+
@run = flag
|
315
|
+
end
|
316
|
+
|
317
|
+
# Already tests have run?
|
318
|
+
def self.run?
|
319
|
+
@run ||= false
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
at_exit do
|
325
|
+
unless $! || Test::Unit.run?
|
326
|
+
exit Test::Unit::AutoRunner.run
|
327
|
+
end
|
328
|
+
end
|