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.
Files changed (667) hide show
  1. data/CHANGELOG +2 -0
  2. data/Manifest.txt +517 -23
  3. data/Rakefile +52 -7
  4. data/doc/build.txt +7 -1
  5. data/doc/device-caps.txt +1 -1
  6. data/doc/install.txt +12 -0
  7. data/doc/jqt-jqm-transition.txt +121 -0
  8. data/doc/release.txt +6 -1
  9. data/doc/ui.txt +4 -2
  10. data/installer/icon.ico +0 -0
  11. data/lib/extensions/barcode/ext/barcode/shared/src/zbar.c +7 -0
  12. data/lib/extensions/barcode/ext/barcode/shared/zbar/rho_bridge.c +3 -3
  13. data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/README.TXT +74 -3
  14. data/lib/extensions/fcntl/ext/Rakefile +57 -38
  15. data/lib/extensions/fcntl/ext/build.bat +1 -0
  16. data/lib/extensions/fcntl/ext/fcntl.vcproj +323 -0
  17. data/lib/extensions/fileutils/fileutils.rb +57 -33
  18. data/lib/extensions/net-http/net/ftp.rb +40 -36
  19. data/lib/extensions/net-http/net/http.rb +98 -38
  20. data/lib/extensions/net-http/net/https.rb +3 -13
  21. data/lib/extensions/net-http/net/protocol.rb +20 -4
  22. data/lib/extensions/rexml/rexml/document.rb +11 -9
  23. data/lib/extensions/rexml/rexml/element.rb +1 -1
  24. data/lib/extensions/rexml/rexml/entity.rb +1 -1
  25. data/lib/extensions/rexml/rexml/formatters/default.rb +3 -1
  26. data/lib/extensions/rexml/rexml/formatters/pretty.rb +1 -1
  27. data/lib/extensions/rexml/rexml/light/node.rb +1 -2
  28. data/lib/extensions/rexml/rexml/parent.rb +1 -0
  29. data/lib/extensions/rexml/rexml/parsers/xpathparser.rb +2 -1
  30. data/lib/extensions/rexml/rexml/quickpath.rb +4 -1
  31. data/lib/extensions/rexml/rexml/rexml.rb +1 -1
  32. data/lib/extensions/rexml/rexml/source.rb +25 -14
  33. data/lib/extensions/rexml/rexml/text.rb +20 -21
  34. data/lib/extensions/rexml/rexml/xmldecl.rb +2 -2
  35. data/lib/extensions/rexml/rexml/xmltokens.rb +2 -2
  36. data/lib/extensions/rexml/rexml/xpath_parser.rb +2 -1
  37. data/lib/extensions/set/set.rb +100 -25
  38. data/lib/extensions/uri/uri/common.rb +134 -4
  39. data/lib/extensions/uri/uri/ftp.rb +14 -3
  40. data/lib/extensions/uri/uri/generic.rb +53 -44
  41. data/lib/extensions/uri/uri/http.rb +1 -1
  42. data/lib/extensions/uri/uri/https.rb +1 -1
  43. data/lib/extensions/uri/uri/ldap.rb +1 -1
  44. data/lib/extensions/uri/uri/mailto.rb +9 -9
  45. data/lib/framework/rho/rhoviewhelpers.rb +3 -2
  46. data/lib/framework/rholang/localization_simplified.rb +5 -3
  47. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Logger.java +14 -1
  48. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +1 -1
  49. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCaptureCallback.java +0 -1
  50. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +12 -5
  51. data/platform/android/build/android.rake +7 -7
  52. data/platform/iphone/Classes/AppManager/AppManager.m +19 -7
  53. data/platform/iphone/rbuild/iphone.rake +1 -1
  54. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
  55. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
  56. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
  57. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
  58. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/phonon.framework/Versions/4/phonon +0 -0
  59. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
  60. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
  61. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
  62. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
  63. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
  64. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
  65. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
  66. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
  67. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
  68. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
  69. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
  70. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
  71. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
  72. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
  73. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/phonon_backend/libphonon_qt7.dylib +0 -0
  74. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib +0 -0
  75. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Resources/rho.icns +0 -0
  76. data/platform/osx/build/osx.rake +25 -3
  77. data/platform/shared/common/AutoPointer.h +1 -1
  78. data/platform/shared/common/RhoStd.h +10 -10
  79. data/platform/shared/common/RhodesAppBase.cpp +3 -0
  80. data/platform/shared/logging/RhoLogConf.cpp +1 -1
  81. data/platform/shared/qt/rhodes/QtMainWindow.cpp +7 -0
  82. data/platform/shared/qt/rhodes/RhoSimulator.h +3 -1
  83. data/platform/shared/qt/rhodes/main.cpp +3 -0
  84. data/platform/shared/qt/rhodes/resources/rho.icns +0 -0
  85. data/platform/shared/qt/rhodes/resources/rho.ico +0 -0
  86. data/platform/shared/qt/rhodes/resources/rho.png +0 -0
  87. data/platform/shared/qt/rhodes/resources/simulator.qrc +5 -0
  88. data/platform/shared/qt/rhodes/rhodes.pro +2 -0
  89. data/platform/shared/ruby/ext/rho/rhosupport.c +21 -2
  90. data/platform/shared/ruby/ext/socket_192/addrinfo.h +191 -0
  91. data/platform/shared/ruby/ext/socket_192/ancdata.c +1800 -0
  92. data/platform/shared/ruby/ext/socket_192/basicsocket.c +771 -0
  93. data/platform/shared/ruby/ext/socket_192/constants.c +145 -0
  94. data/platform/shared/ruby/ext/socket_192/depend +25 -0
  95. data/platform/shared/ruby/ext/socket_192/extconf.rb +365 -0
  96. data/platform/shared/ruby/ext/socket_192/getaddrinfo.c +674 -0
  97. data/platform/shared/ruby/ext/socket_192/getnameinfo.c +260 -0
  98. data/platform/shared/ruby/ext/socket_192/init.c +575 -0
  99. data/platform/shared/ruby/ext/socket_192/ipsocket.c +308 -0
  100. data/platform/shared/ruby/ext/socket_192/lib/socket.rb +755 -0
  101. data/platform/shared/ruby/ext/socket_192/mkconstants.rb +696 -0
  102. data/platform/shared/ruby/ext/socket_192/option.c +692 -0
  103. data/platform/shared/ruby/ext/socket_192/raddrinfo.c +2211 -0
  104. data/platform/shared/ruby/ext/socket_192/rubysocket.h +306 -0
  105. data/platform/shared/ruby/ext/socket_192/socket.c +1870 -0
  106. data/platform/shared/ruby/ext/socket_192/sockport.h +84 -0
  107. data/platform/shared/ruby/ext/socket_192/sockssocket.c +58 -0
  108. data/platform/shared/ruby/ext/socket_192/tcpserver.c +145 -0
  109. data/platform/shared/ruby/ext/socket_192/tcpsocket.c +69 -0
  110. data/platform/shared/ruby/ext/socket_192/udpsocket.c +264 -0
  111. data/platform/shared/ruby/ext/socket_192/unixserver.c +154 -0
  112. data/platform/shared/ruby/ext/socket_192/unixsocket.c +514 -0
  113. data/platform/shared/ruby/ext/stringio/stringio.c +158 -61
  114. data/platform/shared/ruby/ext/strscan/strscan.c +18 -31
  115. data/platform/shared/ruby/iphone/ruby/config.h +2 -1
  116. data/platform/shared/ruby/linux/ruby/config.h +2 -1
  117. data/platform/shared/ruby/symbian/ruby/config.h +2 -1
  118. data/platform/shared/ruby/win32/ruby/config.h +1 -0
  119. data/platform/shared/ruby/win32/ruby/constdefs.c +5866 -0
  120. data/platform/shared/ruby/win32/ruby/constdefs.h +1788 -0
  121. data/platform/shared/ruby/wince/ruby/config.h +1 -0
  122. data/platform/shared/ruby/wince/ruby/constdefs.c +5866 -0
  123. data/platform/shared/ruby/wince/ruby/constdefs.h +1788 -0
  124. data/platform/symbian/build/symbian.rake +8 -0
  125. data/platform/symbian/rhodes/rhodes.pro +3 -3
  126. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  127. data/platform/wm/build/wm.rake +1 -1
  128. data/platform/wm/rhodes/Rhodes.cpp +3 -0
  129. data/platform/wm/rhodes/rhodes.vcproj +612 -6
  130. data/platform/wm/rhodes/rhosim.rc +394 -0
  131. data/platform/wm/rhodes/simulator/MainWindowQt.cpp +2 -2
  132. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +8 -2
  133. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +5 -1
  134. data/platform/wp7/build/wp.rake +1 -1
  135. data/rakefile.rb +52 -7
  136. data/res/generators/templates/application/app/layout.erb +4 -4
  137. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0b3.css → jquery.mobile-1.0rc1.css} +507 -457
  138. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0b3.js → jquery.mobile-1.0rc1.js} +565 -458
  139. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.css +12 -0
  140. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.js +170 -0
  141. data/res/generators/templates/application/public/jquery/{jquery-1.6.3.js → jquery-1.6.4.js} +10 -8
  142. data/res/generators/templates/application/public/jquery/jquery-1.6.4.min.js +4 -0
  143. data/res/generators/templates/application/public/js/jqmobile-patch.js +47 -1
  144. data/res/icons/rho.icns +0 -0
  145. data/res/icons/rho.ico +0 -0
  146. data/res/icons/rho.png +0 -0
  147. data/res/icons/rho.psd +0 -0
  148. data/res/icons/rhodes.icns +0 -0
  149. data/res/icons/rhodes.ico +0 -0
  150. data/res/icons/rhodes.png +0 -0
  151. data/res/icons/rhodes.psd +0 -0
  152. data/res/icons/rhosim.icns +0 -0
  153. data/res/icons/rhosim.ico +0 -0
  154. data/res/icons/rhosim.png +0 -0
  155. data/res/icons/rhosim.psd +0 -0
  156. data/rhodes.gemspec +1 -1
  157. data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +4 -4
  158. data/spec/framework_spec/app/spec/library/net/FTPError_spec.rb +8 -0
  159. data/spec/framework_spec/app/spec/library/net/FTPPermError_spec.rb +12 -0
  160. data/spec/framework_spec/app/spec/library/net/FTPProtoError_spec.rb +12 -0
  161. data/spec/framework_spec/app/spec/library/net/FTPReplyError_spec.rb +12 -0
  162. data/spec/framework_spec/app/spec/library/net/FTPTempError_spec.rb +12 -0
  163. data/spec/framework_spec/app/spec/library/net/ftp/abort_spec.rb +62 -0
  164. data/spec/framework_spec/app/spec/library/net/ftp/acct_spec.rb +58 -0
  165. data/spec/framework_spec/app/spec/library/net/ftp/binary_spec.rb +24 -0
  166. data/spec/framework_spec/app/spec/library/net/ftp/chdir_spec.rb +101 -0
  167. data/spec/framework_spec/app/spec/library/net/ftp/close_spec.rb +28 -0
  168. data/spec/framework_spec/app/spec/library/net/ftp/closed_spec.rb +21 -0
  169. data/spec/framework_spec/app/spec/library/net/ftp/connect_spec.rb +49 -0
  170. data/spec/framework_spec/app/spec/library/net/ftp/debug_mode_spec.rb +23 -0
  171. data/spec/framework_spec/app/spec/library/net/ftp/delete_spec.rb +59 -0
  172. data/spec/framework_spec/app/spec/library/net/ftp/dir_spec.rb +8 -0
  173. data/spec/framework_spec/app/spec/library/net/ftp/fixtures/putbinaryfile +3 -0
  174. data/spec/framework_spec/app/spec/library/net/ftp/fixtures/puttextfile +3 -0
  175. data/spec/framework_spec/app/spec/library/net/ftp/fixtures/server.rb +258 -0
  176. data/spec/framework_spec/app/spec/library/net/ftp/get_spec.rb +21 -0
  177. data/spec/framework_spec/app/spec/library/net/ftp/getbinaryfile_spec.rb +8 -0
  178. data/spec/framework_spec/app/spec/library/net/ftp/getdir_spec.rb +7 -0
  179. data/spec/framework_spec/app/spec/library/net/ftp/gettextfile_spec.rb +8 -0
  180. data/spec/framework_spec/app/spec/library/net/ftp/help_spec.rb +66 -0
  181. data/spec/framework_spec/app/spec/library/net/ftp/initialize_spec.rb +87 -0
  182. data/spec/framework_spec/app/spec/library/net/ftp/last_response_code_spec.rb +8 -0
  183. data/spec/framework_spec/app/spec/library/net/ftp/last_response_spec.rb +25 -0
  184. data/spec/framework_spec/app/spec/library/net/ftp/lastresp_spec.rb +8 -0
  185. data/spec/framework_spec/app/spec/library/net/ftp/list_spec.rb +8 -0
  186. data/spec/framework_spec/app/spec/library/net/ftp/login_spec.rb +216 -0
  187. data/spec/framework_spec/app/spec/library/net/ftp/ls_spec.rb +8 -0
  188. data/spec/framework_spec/app/spec/library/net/ftp/mdtm_spec.rb +38 -0
  189. data/spec/framework_spec/app/spec/library/net/ftp/mkdir_spec.rb +61 -0
  190. data/spec/framework_spec/app/spec/library/net/ftp/mtime_spec.rb +50 -0
  191. data/spec/framework_spec/app/spec/library/net/ftp/nlst_spec.rb +122 -0
  192. data/spec/framework_spec/app/spec/library/net/ftp/noop_spec.rb +38 -0
  193. data/spec/framework_spec/app/spec/library/net/ftp/open_spec.rb +55 -0
  194. data/spec/framework_spec/app/spec/library/net/ftp/passive_spec.rb +24 -0
  195. data/spec/framework_spec/app/spec/library/net/ftp/put_spec.rb +21 -0
  196. data/spec/framework_spec/app/spec/library/net/ftp/putbinaryfile_spec.rb +8 -0
  197. data/spec/framework_spec/app/spec/library/net/ftp/puttextfile_spec.rb +8 -0
  198. data/spec/framework_spec/app/spec/library/net/ftp/pwd_spec.rb +53 -0
  199. data/spec/framework_spec/app/spec/library/net/ftp/quit_spec.rb +33 -0
  200. data/spec/framework_spec/app/spec/library/net/ftp/rename_spec.rb +94 -0
  201. data/spec/framework_spec/app/spec/library/net/ftp/resume_spec.rb +23 -0
  202. data/spec/framework_spec/app/spec/library/net/ftp/retrbinary_spec.rb +31 -0
  203. data/spec/framework_spec/app/spec/library/net/ftp/retrlines_spec.rb +35 -0
  204. data/spec/framework_spec/app/spec/library/net/ftp/return_code_spec.rb +24 -0
  205. data/spec/framework_spec/app/spec/library/net/ftp/rmdir_spec.rb +58 -0
  206. data/spec/framework_spec/app/spec/library/net/ftp/sendcmd_spec.rb +54 -0
  207. data/spec/framework_spec/app/spec/library/net/ftp/set_socket_spec.rb +8 -0
  208. data/spec/framework_spec/app/spec/library/net/ftp/shared/getbinaryfile.rb +180 -0
  209. data/spec/framework_spec/app/spec/library/net/ftp/shared/gettextfile.rb +130 -0
  210. data/spec/framework_spec/app/spec/library/net/ftp/shared/last_response_code.rb +25 -0
  211. data/spec/framework_spec/app/spec/library/net/ftp/shared/list.rb +134 -0
  212. data/spec/framework_spec/app/spec/library/net/ftp/shared/putbinaryfile.rb +233 -0
  213. data/spec/framework_spec/app/spec/library/net/ftp/shared/puttextfile.rb +150 -0
  214. data/spec/framework_spec/app/spec/library/net/ftp/shared/pwd.rb +3 -0
  215. data/spec/framework_spec/app/spec/library/net/ftp/site_spec.rb +53 -0
  216. data/spec/framework_spec/app/spec/library/net/ftp/size_spec.rb +48 -0
  217. data/spec/framework_spec/app/spec/library/net/ftp/status_spec.rb +63 -0
  218. data/spec/framework_spec/app/spec/library/net/ftp/storbinary_spec.rb +49 -0
  219. data/spec/framework_spec/app/spec/library/net/ftp/storlines_spec.rb +44 -0
  220. data/spec/framework_spec/app/spec/library/net/ftp/system_spec.rb +48 -0
  221. data/spec/framework_spec/app/spec/library/net/ftp/voidcmd_spec.rb +54 -0
  222. data/spec/framework_spec/app/spec/library/net/ftp/welcome_spec.rb +25 -0
  223. data/spec/framework_spec/app/spec/library/net/http/HTTPBadResponse_spec.rb +8 -0
  224. data/spec/framework_spec/app/spec/library/net/http/HTTPError_spec.rb +12 -0
  225. data/spec/framework_spec/app/spec/library/net/http/HTTPFatalError_spec.rb +12 -0
  226. data/spec/framework_spec/app/spec/library/net/http/HTTPHeaderSyntaxError_spec.rb +8 -0
  227. data/spec/framework_spec/app/spec/library/net/http/HTTPRetriableError_spec.rb +12 -0
  228. data/spec/framework_spec/app/spec/library/net/http/HTTPServerException_spec.rb +12 -0
  229. data/spec/framework_spec/app/spec/library/net/http/http/Proxy_spec.rb +35 -0
  230. data/spec/framework_spec/app/spec/library/net/http/http/active_spec.rb +8 -0
  231. data/spec/framework_spec/app/spec/library/net/http/http/address_spec.rb +9 -0
  232. data/spec/framework_spec/app/spec/library/net/http/http/close_on_empty_response_spec.rb +10 -0
  233. data/spec/framework_spec/app/spec/library/net/http/http/copy_spec.rb +23 -0
  234. data/spec/framework_spec/app/spec/library/net/http/http/default_port_spec.rb +8 -0
  235. data/spec/framework_spec/app/spec/library/net/http/http/delete_spec.rb +23 -0
  236. data/spec/framework_spec/app/spec/library/net/http/http/finish_spec.rb +31 -0
  237. data/spec/framework_spec/app/spec/library/net/http/http/fixtures/http_server.rb +97 -0
  238. data/spec/framework_spec/app/spec/library/net/http/http/get2_spec.rb +8 -0
  239. data/spec/framework_spec/app/spec/library/net/http/http/get_print_spec.rb +29 -0
  240. data/spec/framework_spec/app/spec/library/net/http/http/get_response_spec.rb +29 -0
  241. data/spec/framework_spec/app/spec/library/net/http/http/get_spec.rb +52 -0
  242. data/spec/framework_spec/app/spec/library/net/http/http/head2_spec.rb +9 -0
  243. data/spec/framework_spec/app/spec/library/net/http/http/head_spec.rb +27 -0
  244. data/spec/framework_spec/app/spec/library/net/http/http/http_default_port_spec.rb +8 -0
  245. data/spec/framework_spec/app/spec/library/net/http/http/https_default_port_spec.rb +8 -0
  246. data/spec/framework_spec/app/spec/library/net/http/http/initialize_spec.rb +46 -0
  247. data/spec/framework_spec/app/spec/library/net/http/http/inspect_spec.rb +26 -0
  248. data/spec/framework_spec/app/spec/library/net/http/http/is_version_1_1_spec.rb +7 -0
  249. data/spec/framework_spec/app/spec/library/net/http/http/is_version_1_2_spec.rb +7 -0
  250. data/spec/framework_spec/app/spec/library/net/http/http/lock_spec.rb +23 -0
  251. data/spec/framework_spec/app/spec/library/net/http/http/mkcol_spec.rb +23 -0
  252. data/spec/framework_spec/app/spec/library/net/http/http/move_spec.rb +27 -0
  253. data/spec/framework_spec/app/spec/library/net/http/http/new_spec.rb +86 -0
  254. data/spec/framework_spec/app/spec/library/net/http/http/newobj_spec.rb +48 -0
  255. data/spec/framework_spec/app/spec/library/net/http/http/open_timeout_spec.rb +24 -0
  256. data/spec/framework_spec/app/spec/library/net/http/http/options_spec.rb +27 -0
  257. data/spec/framework_spec/app/spec/library/net/http/http/port_spec.rb +9 -0
  258. data/spec/framework_spec/app/spec/library/net/http/http/post2_spec.rb +8 -0
  259. data/spec/framework_spec/app/spec/library/net/http/http/post_form_spec.rb +21 -0
  260. data/spec/framework_spec/app/spec/library/net/http/http/post_spec.rb +40 -0
  261. data/spec/framework_spec/app/spec/library/net/http/http/propfind_spec.rb +26 -0
  262. data/spec/framework_spec/app/spec/library/net/http/http/proppatch_spec.rb +26 -0
  263. data/spec/framework_spec/app/spec/library/net/http/http/proxy_address_spec.rb +31 -0
  264. data/spec/framework_spec/app/spec/library/net/http/http/proxy_class_spec.rb +9 -0
  265. data/spec/framework_spec/app/spec/library/net/http/http/proxy_pass_spec.rb +39 -0
  266. data/spec/framework_spec/app/spec/library/net/http/http/proxy_port_spec.rb +39 -0
  267. data/spec/framework_spec/app/spec/library/net/http/http/proxy_user_spec.rb +39 -0
  268. data/spec/framework_spec/app/spec/library/net/http/http/put2_spec.rb +8 -0
  269. data/spec/framework_spec/app/spec/library/net/http/http/put_spec.rb +26 -0
  270. data/spec/framework_spec/app/spec/library/net/http/http/read_timeout_spec.rb +24 -0
  271. data/spec/framework_spec/app/spec/library/net/http/http/request_get_spec.rb +8 -0
  272. data/spec/framework_spec/app/spec/library/net/http/http/request_head_spec.rb +8 -0
  273. data/spec/framework_spec/app/spec/library/net/http/http/request_post_spec.rb +8 -0
  274. data/spec/framework_spec/app/spec/library/net/http/http/request_put_spec.rb +8 -0
  275. data/spec/framework_spec/app/spec/library/net/http/http/request_spec.rb +111 -0
  276. data/spec/framework_spec/app/spec/library/net/http/http/request_types_spec.rb +254 -0
  277. data/spec/framework_spec/app/spec/library/net/http/http/send_request_spec.rb +120 -0
  278. data/spec/framework_spec/app/spec/library/net/http/http/set_debug_output_spec.rb +35 -0
  279. data/spec/framework_spec/app/spec/library/net/http/http/shared/request_get.rb +45 -0
  280. data/spec/framework_spec/app/spec/library/net/http/http/shared/request_head.rb +45 -0
  281. data/spec/framework_spec/app/spec/library/net/http/http/shared/request_post.rb +45 -0
  282. data/spec/framework_spec/app/spec/library/net/http/http/shared/request_put.rb +45 -0
  283. data/spec/framework_spec/app/spec/library/net/http/http/shared/started.rb +28 -0
  284. data/spec/framework_spec/app/spec/library/net/http/http/shared/version_1_1.rb +19 -0
  285. data/spec/framework_spec/app/spec/library/net/http/http/shared/version_1_2.rb +6 -0
  286. data/spec/framework_spec/app/spec/library/net/http/http/socket_type_spec.rb +8 -0
  287. data/spec/framework_spec/app/spec/library/net/http/http/start_spec.rb +103 -0
  288. data/spec/framework_spec/app/spec/library/net/http/http/started_spec.rb +8 -0
  289. data/spec/framework_spec/app/spec/library/net/http/http/trace_spec.rb +26 -0
  290. data/spec/framework_spec/app/spec/library/net/http/http/unlock_spec.rb +26 -0
  291. data/spec/framework_spec/app/spec/library/net/http/http/use_ssl_spec.rb +9 -0
  292. data/spec/framework_spec/app/spec/library/net/http/http/version_1_1_spec.rb +22 -0
  293. data/spec/framework_spec/app/spec/library/net/http/http/version_1_2_spec.rb +20 -0
  294. data/spec/framework_spec/app/spec/library/net/http/httpexceptions/fixtures/classes.rb +5 -0
  295. data/spec/framework_spec/app/spec/library/net/http/httpexceptions/initialize_spec.rb +17 -0
  296. data/spec/framework_spec/app/spec/library/net/http/httpexceptions/response_spec.rb +10 -0
  297. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_exist_spec.rb +27 -0
  298. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_spec.rb +30 -0
  299. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb +32 -0
  300. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/exec_spec.rb +122 -0
  301. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/inspect_spec.rb +25 -0
  302. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/method_spec.rb +15 -0
  303. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/path_spec.rb +12 -0
  304. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/request_body_permitted_spec.rb +12 -0
  305. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/response_body_permitted_spec.rb +12 -0
  306. data/spec/framework_spec/app/spec/library/net/http/httpgenericrequest/set_body_internal_spec.rb +21 -0
  307. data/spec/framework_spec/app/spec/library/net/http/httpheader/add_field_spec.rb +31 -0
  308. data/spec/framework_spec/app/spec/library/net/http/httpheader/basic_auth_spec.rb +14 -0
  309. data/spec/framework_spec/app/spec/library/net/http/httpheader/canonical_each_spec.rb +8 -0
  310. data/spec/framework_spec/app/spec/library/net/http/httpheader/chunked_spec.rb +22 -0
  311. data/spec/framework_spec/app/spec/library/net/http/httpheader/content_length_spec.rb +54 -0
  312. data/spec/framework_spec/app/spec/library/net/http/httpheader/content_range_spec.rb +34 -0
  313. data/spec/framework_spec/app/spec/library/net/http/httpheader/content_type_spec.rb +26 -0
  314. data/spec/framework_spec/app/spec/library/net/http/httpheader/delete_spec.rb +30 -0
  315. data/spec/framework_spec/app/spec/library/net/http/httpheader/each_capitalized_name_spec.rb +45 -0
  316. data/spec/framework_spec/app/spec/library/net/http/httpheader/each_capitalized_spec.rb +9 -0
  317. data/spec/framework_spec/app/spec/library/net/http/httpheader/each_header_spec.rb +8 -0
  318. data/spec/framework_spec/app/spec/library/net/http/httpheader/each_key_spec.rb +8 -0
  319. data/spec/framework_spec/app/spec/library/net/http/httpheader/each_name_spec.rb +8 -0
  320. data/spec/framework_spec/app/spec/library/net/http/httpheader/each_spec.rb +8 -0
  321. data/spec/framework_spec/app/spec/library/net/http/httpheader/each_value_spec.rb +46 -0
  322. data/spec/framework_spec/app/spec/library/net/http/httpheader/element_reference_spec.rb +39 -0
  323. data/spec/framework_spec/app/spec/library/net/http/httpheader/element_set_spec.rb +41 -0
  324. data/spec/framework_spec/app/spec/library/net/http/httpheader/fetch_spec.rb +69 -0
  325. data/spec/framework_spec/app/spec/library/net/http/httpheader/fixtures/classes.rb +11 -0
  326. data/spec/framework_spec/app/spec/library/net/http/httpheader/form_data_spec.rb +8 -0
  327. data/spec/framework_spec/app/spec/library/net/http/httpheader/get_fields_spec.rb +39 -0
  328. data/spec/framework_spec/app/spec/library/net/http/httpheader/initialize_http_header_spec.rb +29 -0
  329. data/spec/framework_spec/app/spec/library/net/http/httpheader/key_spec.rb +21 -0
  330. data/spec/framework_spec/app/spec/library/net/http/httpheader/length_spec.rb +8 -0
  331. data/spec/framework_spec/app/spec/library/net/http/httpheader/main_type_spec.rb +24 -0
  332. data/spec/framework_spec/app/spec/library/net/http/httpheader/proxy_basic_auth_spec.rb +14 -0
  333. data/spec/framework_spec/app/spec/library/net/http/httpheader/range_length_spec.rb +32 -0
  334. data/spec/framework_spec/app/spec/library/net/http/httpheader/range_spec.rb +48 -0
  335. data/spec/framework_spec/app/spec/library/net/http/httpheader/set_content_type_spec.rb +8 -0
  336. data/spec/framework_spec/app/spec/library/net/http/httpheader/set_form_data_spec.rb +8 -0
  337. data/spec/framework_spec/app/spec/library/net/http/httpheader/set_range_spec.rb +8 -0
  338. data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/each_capitalized.rb +42 -0
  339. data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/each_header.rb +42 -0
  340. data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/each_name.rb +39 -0
  341. data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/set_content_type.rb +18 -0
  342. data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/set_form_data.rb +27 -0
  343. data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/set_range.rb +89 -0
  344. data/spec/framework_spec/app/spec/library/net/http/httpheader/shared/size.rb +18 -0
  345. data/spec/framework_spec/app/spec/library/net/http/httpheader/size_spec.rb +8 -0
  346. data/spec/framework_spec/app/spec/library/net/http/httpheader/sub_type_spec.rb +32 -0
  347. data/spec/framework_spec/app/spec/library/net/http/httpheader/to_hash_spec.rb +25 -0
  348. data/spec/framework_spec/app/spec/library/net/http/httpheader/type_params_spec.rb +24 -0
  349. data/spec/framework_spec/app/spec/library/net/http/httprequest/initialize_spec.rb +45 -0
  350. data/spec/framework_spec/app/spec/library/net/http/httpresponse/body_permitted_spec.rb +13 -0
  351. data/spec/framework_spec/app/spec/library/net/http/httpresponse/body_spec.rb +7 -0
  352. data/spec/framework_spec/app/spec/library/net/http/httpresponse/code_spec.rb +24 -0
  353. data/spec/framework_spec/app/spec/library/net/http/httpresponse/code_type_spec.rb +24 -0
  354. data/spec/framework_spec/app/spec/library/net/http/httpresponse/entity_spec.rb +7 -0
  355. data/spec/framework_spec/app/spec/library/net/http/httpresponse/error_spec.rb +24 -0
  356. data/spec/framework_spec/app/spec/library/net/http/httpresponse/error_type_spec.rb +24 -0
  357. data/spec/framework_spec/app/spec/library/net/http/httpresponse/exception_type_spec.rb +13 -0
  358. data/spec/framework_spec/app/spec/library/net/http/httpresponse/header_spec.rb +9 -0
  359. data/spec/framework_spec/app/spec/library/net/http/httpresponse/http_version_spec.rb +12 -0
  360. data/spec/framework_spec/app/spec/library/net/http/httpresponse/initialize_spec.rb +11 -0
  361. data/spec/framework_spec/app/spec/library/net/http/httpresponse/inspect_spec.rb +15 -0
  362. data/spec/framework_spec/app/spec/library/net/http/httpresponse/message_spec.rb +9 -0
  363. data/spec/framework_spec/app/spec/library/net/http/httpresponse/msg_spec.rb +9 -0
  364. data/spec/framework_spec/app/spec/library/net/http/httpresponse/read_body_spec.rb +86 -0
  365. data/spec/framework_spec/app/spec/library/net/http/httpresponse/read_header_spec.rb +9 -0
  366. data/spec/framework_spec/app/spec/library/net/http/httpresponse/read_new_spec.rb +22 -0
  367. data/spec/framework_spec/app/spec/library/net/http/httpresponse/reading_body_spec.rb +58 -0
  368. data/spec/framework_spec/app/spec/library/net/http/httpresponse/response_spec.rb +9 -0
  369. data/spec/framework_spec/app/spec/library/net/http/httpresponse/shared/body.rb +18 -0
  370. data/spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb +26 -0
  371. data/spec/framework_spec/app/spec/library/net/http/httpresponse/value_spec.rb +24 -0
  372. data/spec/framework_spec/app/spec/library/rexml/attribute/clone_spec.rb +11 -0
  373. data/spec/framework_spec/app/spec/library/rexml/attribute/element_spec.rb +23 -0
  374. data/spec/framework_spec/app/spec/library/rexml/attribute/equal_value_spec.rb +18 -0
  375. data/spec/framework_spec/app/spec/library/rexml/attribute/hash_spec.rb +13 -0
  376. data/spec/framework_spec/app/spec/library/rexml/attribute/initialize_spec.rb +29 -0
  377. data/spec/framework_spec/app/spec/library/rexml/attribute/inspect_spec.rb +20 -0
  378. data/spec/framework_spec/app/spec/library/rexml/attribute/namespace_spec.rb +24 -0
  379. data/spec/framework_spec/app/spec/library/rexml/attribute/node_type_spec.rb +10 -0
  380. data/spec/framework_spec/app/spec/library/rexml/attribute/prefix_spec.rb +18 -0
  381. data/spec/framework_spec/app/spec/library/rexml/attribute/remove_spec.rb +20 -0
  382. data/spec/framework_spec/app/spec/library/rexml/attribute/to_s_spec.rb +14 -0
  383. data/spec/framework_spec/app/spec/library/rexml/attribute/to_string_spec.rb +15 -0
  384. data/spec/framework_spec/app/spec/library/rexml/attribute/value_spec.rb +15 -0
  385. data/spec/framework_spec/app/spec/library/rexml/attribute/write_spec.rb +23 -0
  386. data/spec/framework_spec/app/spec/library/rexml/attribute/xpath_spec.rb +20 -0
  387. data/spec/framework_spec/app/spec/library/rexml/attributes/add_spec.rb +7 -0
  388. data/spec/framework_spec/app/spec/library/rexml/attributes/append_spec.rb +7 -0
  389. data/spec/framework_spec/app/spec/library/rexml/attributes/delete_all_spec.rb +31 -0
  390. data/spec/framework_spec/app/spec/library/rexml/attributes/delete_spec.rb +27 -0
  391. data/spec/framework_spec/app/spec/library/rexml/attributes/each_attribute_spec.rb +24 -0
  392. data/spec/framework_spec/app/spec/library/rexml/attributes/each_spec.rb +24 -0
  393. data/spec/framework_spec/app/spec/library/rexml/attributes/element_reference_spec.rb +19 -0
  394. data/spec/framework_spec/app/spec/library/rexml/attributes/element_set_spec.rb +26 -0
  395. data/spec/framework_spec/app/spec/library/rexml/attributes/get_attribute_ns_spec.rb +14 -0
  396. data/spec/framework_spec/app/spec/library/rexml/attributes/get_attribute_spec.rb +29 -0
  397. data/spec/framework_spec/app/spec/library/rexml/attributes/initialize_spec.rb +19 -0
  398. data/spec/framework_spec/app/spec/library/rexml/attributes/length_spec.rb +7 -0
  399. data/spec/framework_spec/app/spec/library/rexml/attributes/namespaces_spec.rb +6 -0
  400. data/spec/framework_spec/app/spec/library/rexml/attributes/prefixes_spec.rb +24 -0
  401. data/spec/framework_spec/app/spec/library/rexml/attributes/shared/add.rb +17 -0
  402. data/spec/framework_spec/app/spec/library/rexml/attributes/shared/length.rb +13 -0
  403. data/spec/framework_spec/app/spec/library/rexml/attributes/size_spec.rb +7 -0
  404. data/spec/framework_spec/app/spec/library/rexml/attributes/to_a_spec.rb +20 -0
  405. data/spec/framework_spec/app/spec/library/rexml/cdata/clone_spec.rb +10 -0
  406. data/spec/framework_spec/app/spec/library/rexml/cdata/initialize_spec.rb +25 -0
  407. data/spec/framework_spec/app/spec/library/rexml/cdata/shared/to_s.rb +11 -0
  408. data/spec/framework_spec/app/spec/library/rexml/cdata/to_s_spec.rb +7 -0
  409. data/spec/framework_spec/app/spec/library/rexml/cdata/value_spec.rb +7 -0
  410. data/spec/framework_spec/app/spec/library/rexml/document/add_element_spec.rb +31 -0
  411. data/spec/framework_spec/app/spec/library/rexml/document/add_spec.rb +61 -0
  412. data/spec/framework_spec/app/spec/library/rexml/document/clone_spec.rb +20 -0
  413. data/spec/framework_spec/app/spec/library/rexml/document/doctype_spec.rb +15 -0
  414. data/spec/framework_spec/app/spec/library/rexml/document/encoding_spec.rb +22 -0
  415. data/spec/framework_spec/app/spec/library/rexml/document/expanded_name_spec.rb +16 -0
  416. data/spec/framework_spec/app/spec/library/rexml/document/new_spec.rb +38 -0
  417. data/spec/framework_spec/app/spec/library/rexml/document/node_type_spec.rb +8 -0
  418. data/spec/framework_spec/app/spec/library/rexml/document/root_spec.rb +12 -0
  419. data/spec/framework_spec/app/spec/library/rexml/document/stand_alone_spec.rb +19 -0
  420. data/spec/framework_spec/app/spec/library/rexml/document/version_spec.rb +14 -0
  421. data/spec/framework_spec/app/spec/library/rexml/document/write_spec.rb +39 -0
  422. data/spec/framework_spec/app/spec/library/rexml/document/xml_decl_spec.rb +15 -0
  423. data/spec/framework_spec/app/spec/library/rexml/element/add_attribute_spec.rb +41 -0
  424. data/spec/framework_spec/app/spec/library/rexml/element/add_attributes_spec.rb +22 -0
  425. data/spec/framework_spec/app/spec/library/rexml/element/add_element_spec.rb +39 -0
  426. data/spec/framework_spec/app/spec/library/rexml/element/add_namespace_spec.rb +24 -0
  427. data/spec/framework_spec/app/spec/library/rexml/element/add_text_spec.rb +24 -0
  428. data/spec/framework_spec/app/spec/library/rexml/element/attribute_spec.rb +17 -0
  429. data/spec/framework_spec/app/spec/library/rexml/element/attributes_spec.rb +19 -0
  430. data/spec/framework_spec/app/spec/library/rexml/element/cdatas_spec.rb +24 -0
  431. data/spec/framework_spec/app/spec/library/rexml/element/clone_spec.rb +29 -0
  432. data/spec/framework_spec/app/spec/library/rexml/element/comments_spec.rb +21 -0
  433. data/spec/framework_spec/app/spec/library/rexml/element/delete_attribute_spec.rb +39 -0
  434. data/spec/framework_spec/app/spec/library/rexml/element/delete_element_spec.rb +51 -0
  435. data/spec/framework_spec/app/spec/library/rexml/element/delete_namespace_spec.rb +25 -0
  436. data/spec/framework_spec/app/spec/library/rexml/element/document_spec.rb +18 -0
  437. data/spec/framework_spec/app/spec/library/rexml/element/each_element_with_attribute_spec.rb +35 -0
  438. data/spec/framework_spec/app/spec/library/rexml/element/each_element_with_text_spec.rb +31 -0
  439. data/spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb +18 -0
  440. data/spec/framework_spec/app/spec/library/rexml/element/has_attributes_spec.rb +17 -0
  441. data/spec/framework_spec/app/spec/library/rexml/element/has_elements_spec.rb +18 -0
  442. data/spec/framework_spec/app/spec/library/rexml/element/has_text_spec.rb +16 -0
  443. data/spec/framework_spec/app/spec/library/rexml/element/inspect_spec.rb +27 -0
  444. data/spec/framework_spec/app/spec/library/rexml/element/instructions_spec.rb +21 -0
  445. data/spec/framework_spec/app/spec/library/rexml/element/namespace_spec.rb +27 -0
  446. data/spec/framework_spec/app/spec/library/rexml/element/namespaces_spec.rb +32 -0
  447. data/spec/framework_spec/app/spec/library/rexml/element/new_spec.rb +35 -0
  448. data/spec/framework_spec/app/spec/library/rexml/element/next_element_spec.rb +19 -0
  449. data/spec/framework_spec/app/spec/library/rexml/element/node_type_spec.rb +8 -0
  450. data/spec/framework_spec/app/spec/library/rexml/element/prefixes_spec.rb +23 -0
  451. data/spec/framework_spec/app/spec/library/rexml/element/previous_element_spec.rb +20 -0
  452. data/spec/framework_spec/app/spec/library/rexml/element/raw_spec.rb +24 -0
  453. data/spec/framework_spec/app/spec/library/rexml/element/root_spec.rb +28 -0
  454. data/spec/framework_spec/app/spec/library/rexml/element/text_spec.rb +46 -0
  455. data/spec/framework_spec/app/spec/library/rexml/element/texts_spec.rb +16 -0
  456. data/spec/framework_spec/app/spec/library/rexml/element/whitespace_spec.rb +23 -0
  457. data/spec/framework_spec/app/spec/library/rexml/node/each_recursive_spec.rb +21 -0
  458. data/spec/framework_spec/app/spec/library/rexml/node/find_first_recursive_spec.rb +25 -0
  459. data/spec/framework_spec/app/spec/library/rexml/node/index_in_parent_spec.rb +15 -0
  460. data/spec/framework_spec/app/spec/library/rexml/node/next_sibling_node_spec.rb +21 -0
  461. data/spec/framework_spec/app/spec/library/rexml/node/parent_spec.rb +21 -0
  462. data/spec/framework_spec/app/spec/library/rexml/node/previous_sibling_node_spec.rb +21 -0
  463. data/spec/framework_spec/app/spec/library/rexml/shared/each_element.rb +36 -0
  464. data/spec/framework_spec/app/spec/library/rexml/shared/elements_to_a.rb +36 -0
  465. data/spec/framework_spec/app/spec/library/rexml/text/append_spec.rb +10 -0
  466. data/spec/framework_spec/app/spec/library/rexml/text/clone_spec.rb +10 -0
  467. data/spec/framework_spec/app/spec/library/rexml/text/comparison_spec.rb +25 -0
  468. data/spec/framework_spec/app/spec/library/rexml/text/empty_spec.rb +12 -0
  469. data/spec/framework_spec/app/spec/library/rexml/text/indent_text_spec.rb +24 -0
  470. data/spec/framework_spec/app/spec/library/rexml/text/inspect_spec.rb +8 -0
  471. data/spec/framework_spec/app/spec/library/rexml/text/new_spec.rb +49 -0
  472. data/spec/framework_spec/app/spec/library/rexml/text/node_type_spec.rb +8 -0
  473. data/spec/framework_spec/app/spec/library/rexml/text/normalize_spec.rb +8 -0
  474. data/spec/framework_spec/app/spec/library/rexml/text/read_with_substitution_spec.rb +13 -0
  475. data/spec/framework_spec/app/spec/library/rexml/text/to_s_spec.rb +18 -0
  476. data/spec/framework_spec/app/spec/library/rexml/text/unnormalize_spec.rb +8 -0
  477. data/spec/framework_spec/app/spec/library/rexml/text/value_spec.rb +37 -0
  478. data/spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb +21 -0
  479. data/spec/framework_spec/app/spec/library/rexml/text/write_with_substitution_spec.rb +33 -0
  480. data/spec/framework_spec/app/spec/library/set/exclusion_spec.rb +2 -2
  481. data/spec/framework_spec/app/spec/library/set/merge_spec.rb +2 -2
  482. data/spec/framework_spec/app/spec/library/set/shared/difference.rb +2 -2
  483. data/spec/framework_spec/app/spec/library/set/shared/intersection.rb +2 -2
  484. data/spec/framework_spec/app/spec/library/set/shared/union.rb +2 -2
  485. data/spec/framework_spec/app/spec/library/set/sortedset/exclusion_spec.rb +2 -2
  486. data/spec/framework_spec/app/spec/library/set/sortedset/merge_spec.rb +2 -2
  487. data/spec/framework_spec/app/spec/library/set/sortedset/shared/difference.rb +2 -2
  488. data/spec/framework_spec/app/spec/library/set/sortedset/shared/intersection.rb +2 -2
  489. data/spec/framework_spec/app/spec/library/set/sortedset/shared/union.rb +2 -2
  490. data/spec/framework_spec/app/spec/library/timeout/timeout_spec.rb +37 -0
  491. data/spec/framework_spec/app/spec/library/uri/eql_spec.rb +12 -0
  492. data/spec/framework_spec/app/spec/library/uri/equality_spec.rb +48 -0
  493. data/spec/framework_spec/app/spec/library/uri/escape/decode_spec.rb +6 -0
  494. data/spec/framework_spec/app/spec/library/uri/escape/encode_spec.rb +6 -0
  495. data/spec/framework_spec/app/spec/library/uri/escape/escape_spec.rb +6 -0
  496. data/spec/framework_spec/app/spec/library/uri/escape/unescape_spec.rb +6 -0
  497. data/spec/framework_spec/app/spec/library/uri/extract_spec.rb +86 -0
  498. data/spec/framework_spec/app/spec/library/uri/fixtures/classes.rb +11 -0
  499. data/spec/framework_spec/app/spec/library/uri/fixtures/normalization.rb +54 -0
  500. data/spec/framework_spec/app/spec/library/uri/ftp/build_spec.rb +6 -0
  501. data/spec/framework_spec/app/spec/library/uri/ftp/merge_spec.rb +6 -0
  502. data/spec/framework_spec/app/spec/library/uri/ftp/new2_spec.rb +6 -0
  503. data/spec/framework_spec/app/spec/library/uri/ftp/path_spec.rb +56 -0
  504. data/spec/framework_spec/app/spec/library/uri/ftp/set_typecode_spec.rb +6 -0
  505. data/spec/framework_spec/app/spec/library/uri/ftp/to_s_spec.rb +25 -0
  506. data/spec/framework_spec/app/spec/library/uri/ftp/typecode_spec.rb +10 -0
  507. data/spec/framework_spec/app/spec/library/uri/generic/absolute_spec.rb +10 -0
  508. data/spec/framework_spec/app/spec/library/uri/generic/build2_spec.rb +6 -0
  509. data/spec/framework_spec/app/spec/library/uri/generic/build_spec.rb +6 -0
  510. data/spec/framework_spec/app/spec/library/uri/generic/coerce_spec.rb +6 -0
  511. data/spec/framework_spec/app/spec/library/uri/generic/component_ary_spec.rb +6 -0
  512. data/spec/framework_spec/app/spec/library/uri/generic/component_spec.rb +10 -0
  513. data/spec/framework_spec/app/spec/library/uri/generic/default_port_spec.rb +10 -0
  514. data/spec/framework_spec/app/spec/library/uri/generic/eql_spec.rb +6 -0
  515. data/spec/framework_spec/app/spec/library/uri/generic/equal_value_spec.rb +6 -0
  516. data/spec/framework_spec/app/spec/library/uri/generic/fragment_spec.rb +10 -0
  517. data/spec/framework_spec/app/spec/library/uri/generic/hash_spec.rb +6 -0
  518. data/spec/framework_spec/app/spec/library/uri/generic/hierarchical_spec.rb +6 -0
  519. data/spec/framework_spec/app/spec/library/uri/generic/host_spec.rb +10 -0
  520. data/spec/framework_spec/app/spec/library/uri/generic/inspect_spec.rb +6 -0
  521. data/spec/framework_spec/app/spec/library/uri/generic/merge_spec.rb +10 -0
  522. data/spec/framework_spec/app/spec/library/uri/generic/minus_spec.rb +6 -0
  523. data/spec/framework_spec/app/spec/library/uri/generic/normalize_spec.rb +10 -0
  524. data/spec/framework_spec/app/spec/library/uri/generic/opaque_spec.rb +10 -0
  525. data/spec/framework_spec/app/spec/library/uri/generic/password_spec.rb +10 -0
  526. data/spec/framework_spec/app/spec/library/uri/generic/path_spec.rb +10 -0
  527. data/spec/framework_spec/app/spec/library/uri/generic/plus_spec.rb +6 -0
  528. data/spec/framework_spec/app/spec/library/uri/generic/port_spec.rb +10 -0
  529. data/spec/framework_spec/app/spec/library/uri/generic/query_spec.rb +10 -0
  530. data/spec/framework_spec/app/spec/library/uri/generic/registry_spec.rb +10 -0
  531. data/spec/framework_spec/app/spec/library/uri/generic/relative_spec.rb +6 -0
  532. data/spec/framework_spec/app/spec/library/uri/generic/route_from_spec.rb +6 -0
  533. data/spec/framework_spec/app/spec/library/uri/generic/route_to_spec.rb +6 -0
  534. data/spec/framework_spec/app/spec/library/uri/generic/scheme_spec.rb +10 -0
  535. data/spec/framework_spec/app/spec/library/uri/generic/select_spec.rb +6 -0
  536. data/spec/framework_spec/app/spec/library/uri/generic/set_fragment_spec.rb +6 -0
  537. data/spec/framework_spec/app/spec/library/uri/generic/set_host_spec.rb +6 -0
  538. data/spec/framework_spec/app/spec/library/uri/generic/set_opaque_spec.rb +6 -0
  539. data/spec/framework_spec/app/spec/library/uri/generic/set_password_spec.rb +6 -0
  540. data/spec/framework_spec/app/spec/library/uri/generic/set_path_spec.rb +6 -0
  541. data/spec/framework_spec/app/spec/library/uri/generic/set_port_spec.rb +6 -0
  542. data/spec/framework_spec/app/spec/library/uri/generic/set_query_spec.rb +6 -0
  543. data/spec/framework_spec/app/spec/library/uri/generic/set_registry_spec.rb +6 -0
  544. data/spec/framework_spec/app/spec/library/uri/generic/set_scheme_spec.rb +6 -0
  545. data/spec/framework_spec/app/spec/library/uri/generic/set_user_spec.rb +6 -0
  546. data/spec/framework_spec/app/spec/library/uri/generic/set_userinfo_spec.rb +6 -0
  547. data/spec/framework_spec/app/spec/library/uri/generic/to_s_spec.rb +6 -0
  548. data/spec/framework_spec/app/spec/library/uri/generic/use_registry_spec.rb +6 -0
  549. data/spec/framework_spec/app/spec/library/uri/generic/user_spec.rb +10 -0
  550. data/spec/framework_spec/app/spec/library/uri/generic/userinfo_spec.rb +10 -0
  551. data/spec/framework_spec/app/spec/library/uri/http/build_spec.rb +6 -0
  552. data/spec/framework_spec/app/spec/library/uri/http/request_uri_spec.rb +16 -0
  553. data/spec/framework_spec/app/spec/library/uri/join_spec.rb +61 -0
  554. data/spec/framework_spec/app/spec/library/uri/ldap/attributes_spec.rb +10 -0
  555. data/spec/framework_spec/app/spec/library/uri/ldap/build_spec.rb +6 -0
  556. data/spec/framework_spec/app/spec/library/uri/ldap/dn_spec.rb +10 -0
  557. data/spec/framework_spec/app/spec/library/uri/ldap/extensions_spec.rb +10 -0
  558. data/spec/framework_spec/app/spec/library/uri/ldap/filter_spec.rb +10 -0
  559. data/spec/framework_spec/app/spec/library/uri/ldap/hierarchical_spec.rb +6 -0
  560. data/spec/framework_spec/app/spec/library/uri/ldap/scope_spec.rb +10 -0
  561. data/spec/framework_spec/app/spec/library/uri/ldap/set_attributes_spec.rb +6 -0
  562. data/spec/framework_spec/app/spec/library/uri/ldap/set_dn_spec.rb +6 -0
  563. data/spec/framework_spec/app/spec/library/uri/ldap/set_extensions_spec.rb +6 -0
  564. data/spec/framework_spec/app/spec/library/uri/ldap/set_filter_spec.rb +6 -0
  565. data/spec/framework_spec/app/spec/library/uri/ldap/set_scope_spec.rb +6 -0
  566. data/spec/framework_spec/app/spec/library/uri/mailto/build_spec.rb +99 -0
  567. data/spec/framework_spec/app/spec/library/uri/mailto/headers_spec.rb +10 -0
  568. data/spec/framework_spec/app/spec/library/uri/mailto/set_headers_spec.rb +6 -0
  569. data/spec/framework_spec/app/spec/library/uri/mailto/set_to_spec.rb +6 -0
  570. data/spec/framework_spec/app/spec/library/uri/mailto/to_mailtext_spec.rb +6 -0
  571. data/spec/framework_spec/app/spec/library/uri/mailto/to_rfc822text_spec.rb +6 -0
  572. data/spec/framework_spec/app/spec/library/uri/mailto/to_s_spec.rb +6 -0
  573. data/spec/framework_spec/app/spec/library/uri/mailto/to_spec.rb +10 -0
  574. data/spec/framework_spec/app/spec/library/uri/merge_spec.rb +22 -0
  575. data/spec/framework_spec/app/spec/library/uri/normalize_spec.rb +35 -0
  576. data/spec/framework_spec/app/spec/library/uri/parse_spec.rb +249 -0
  577. data/spec/framework_spec/app/spec/library/uri/plus_spec.rb +489 -0
  578. data/spec/framework_spec/app/spec/library/uri/regexp_spec.rb +18 -0
  579. data/spec/framework_spec/app/spec/library/uri/route_from_spec.rb +25 -0
  580. data/spec/framework_spec/app/spec/library/uri/route_to_spec.rb +28 -0
  581. data/spec/framework_spec/app/spec/library/uri/select_spec.rb +31 -0
  582. data/spec/framework_spec/app/spec/library/uri/set_component_spec.rb +47 -0
  583. data/spec/framework_spec/app/spec/library/uri/shared/eql.rb +17 -0
  584. data/spec/framework_spec/app/spec/library/uri/split_spec.rb +6 -0
  585. data/spec/framework_spec/app/spec/library/uri/uri_spec.rb +31 -0
  586. data/spec/framework_spec/app/spec/library/uri/util/make_components_hash_spec.rb +6 -0
  587. data/spec/framework_spec/build.yml +2 -2
  588. data/spec/framework_spec/extensions/test-libs/test/unit.rb +328 -0
  589. data/spec/framework_spec/extensions/test-libs/test/unit/assertionfailederror.rb +25 -0
  590. data/spec/framework_spec/extensions/test-libs/test/unit/assertions.rb +1878 -0
  591. data/spec/framework_spec/extensions/test-libs/test/unit/attribute.rb +129 -0
  592. data/spec/framework_spec/extensions/test-libs/test/unit/autorunner.rb +422 -0
  593. data/spec/framework_spec/extensions/test-libs/test/unit/collector.rb +38 -0
  594. data/spec/framework_spec/extensions/test-libs/test/unit/collector/descendant.rb +23 -0
  595. data/spec/framework_spec/extensions/test-libs/test/unit/collector/dir.rb +108 -0
  596. data/spec/framework_spec/extensions/test-libs/test/unit/collector/load.rb +187 -0
  597. data/spec/framework_spec/extensions/test-libs/test/unit/collector/objectspace.rb +34 -0
  598. data/spec/framework_spec/extensions/test-libs/test/unit/collector/xml.rb +250 -0
  599. data/spec/framework_spec/extensions/test-libs/test/unit/color-scheme.rb +153 -0
  600. data/spec/framework_spec/extensions/test-libs/test/unit/color.rb +123 -0
  601. data/spec/framework_spec/extensions/test-libs/test/unit/data.rb +80 -0
  602. data/spec/framework_spec/extensions/test-libs/test/unit/diff.rb +740 -0
  603. data/spec/framework_spec/extensions/test-libs/test/unit/error.rb +151 -0
  604. data/spec/framework_spec/extensions/test-libs/test/unit/exceptionhandler.rb +39 -0
  605. data/spec/framework_spec/extensions/test-libs/test/unit/failure.rb +136 -0
  606. data/spec/framework_spec/extensions/test-libs/test/unit/fixture.rb +214 -0
  607. data/spec/framework_spec/extensions/test-libs/test/unit/notification.rb +133 -0
  608. data/spec/framework_spec/extensions/test-libs/test/unit/omission.rb +191 -0
  609. data/spec/framework_spec/extensions/test-libs/test/unit/pending.rb +150 -0
  610. data/spec/framework_spec/extensions/test-libs/test/unit/priority.rb +182 -0
  611. data/spec/framework_spec/extensions/test-libs/test/unit/runner/console.rb +59 -0
  612. data/spec/framework_spec/extensions/test-libs/test/unit/runner/emacs.rb +8 -0
  613. data/spec/framework_spec/extensions/test-libs/test/unit/runner/tap.rb +8 -0
  614. data/spec/framework_spec/extensions/test-libs/test/unit/runner/xml.rb +15 -0
  615. data/spec/framework_spec/extensions/test-libs/test/unit/testcase.rb +601 -0
  616. data/spec/framework_spec/extensions/test-libs/test/unit/testresult.rb +125 -0
  617. data/spec/framework_spec/extensions/test-libs/test/unit/testsuite.rb +134 -0
  618. data/spec/framework_spec/extensions/test-libs/test/unit/testsuitecreator.rb +79 -0
  619. data/spec/framework_spec/extensions/test-libs/test/unit/ui/console/outputlevel.rb +15 -0
  620. data/spec/framework_spec/extensions/test-libs/test/unit/ui/console/testrunner.rb +561 -0
  621. data/spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb +63 -0
  622. data/spec/framework_spec/extensions/test-libs/test/unit/ui/tap/testrunner.rb +82 -0
  623. data/spec/framework_spec/extensions/test-libs/test/unit/ui/testrunner.rb +53 -0
  624. data/spec/framework_spec/extensions/test-libs/test/unit/ui/testrunnermediator.rb +86 -0
  625. data/spec/framework_spec/extensions/test-libs/test/unit/ui/testrunnerutilities.rb +41 -0
  626. data/spec/framework_spec/extensions/test-libs/test/unit/ui/xml/testrunner.rb +224 -0
  627. data/spec/framework_spec/extensions/test-libs/test/unit/util/backtracefilter.rb +42 -0
  628. data/spec/framework_spec/extensions/test-libs/test/unit/util/method-owner-finder.rb +28 -0
  629. data/spec/framework_spec/extensions/test-libs/test/unit/util/observable.rb +90 -0
  630. data/spec/framework_spec/extensions/test-libs/test/unit/util/output.rb +31 -0
  631. data/spec/framework_spec/extensions/test-libs/test/unit/util/procwrapper.rb +48 -0
  632. data/spec/framework_spec/extensions/test-libs/test/unit/version.rb +5 -0
  633. data/spec/framework_spec/extensions/test-libs/webrick/accesslog.rb +10 -2
  634. data/spec/framework_spec/extensions/test-libs/webrick/cgi.rb +1 -1
  635. data/spec/framework_spec/extensions/test-libs/webrick/config.rb +1 -1
  636. data/spec/framework_spec/extensions/test-libs/webrick/httpauth/digestauth.rb +1 -1
  637. data/spec/framework_spec/extensions/test-libs/webrick/httpresponse.rb +1 -1
  638. data/spec/framework_spec/extensions/test-libs/webrick/https.rb +2 -2
  639. data/spec/framework_spec/extensions/test-libs/webrick/httpservlet/abstract.rb +1 -2
  640. data/spec/framework_spec/extensions/test-libs/webrick/httpservlet/cgihandler.rb +2 -2
  641. data/spec/framework_spec/extensions/test-libs/webrick/httpservlet/filehandler.rb +9 -5
  642. data/spec/framework_spec/extensions/test-libs/webrick/httpstatus.rb +32 -321
  643. data/spec/framework_spec/extensions/test-libs/webrick/httputils.rb +3 -3
  644. data/spec/framework_spec/extensions/test-libs/webrick/ssl.rb +3 -2
  645. data/spec/phone_spec/build.yml +1 -1
  646. data/version +1 -0
  647. metadata +521 -27
  648. data/lib/extensions/net-http/monitor.rb +0 -265
  649. data/lib/extensions/net-http/thread.rb +0 -367
  650. data/lib/extensions/net-http/timeout.rb +0 -114
  651. data/lib/extensions/net-http/uri.rb +0 -29
  652. data/lib/extensions/net-http/uri/common.rb +0 -727
  653. data/lib/extensions/net-http/uri/ftp.rb +0 -198
  654. data/lib/extensions/net-http/uri/generic.rb +0 -1128
  655. data/lib/extensions/net-http/uri/http.rb +0 -100
  656. data/lib/extensions/net-http/uri/https.rb +0 -20
  657. data/lib/extensions/net-http/uri/ldap.rb +0 -190
  658. data/lib/extensions/net-http/uri/ldaps.rb +0 -12
  659. data/lib/extensions/net-http/uri/mailto.rb +0 -266
  660. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtDBus.framework/Versions/4/QtDBus +0 -0
  661. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtXml.framework/Versions/4/QtXml +0 -0
  662. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libtcpserver.dylib +0 -0
  663. data/res/generators/templates/application/public/jqmobile/images/icon-search-black.png +0 -0
  664. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b3.min.css +0 -8
  665. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b3.min.js +0 -169
  666. data/res/generators/templates/application/public/jquery/jquery-1.6.3.min.js +0 -4
  667. 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,6 @@
1
+ require File.expand_path('../../../../spec_helper', __FILE__)
2
+ require 'uri'
3
+
4
+ describe "URI::MailTo#set_headers" do
5
+ it "needs to be reviewed for spec completeness"
6
+ end
@@ -0,0 +1,6 @@
1
+ require File.expand_path('../../../../spec_helper', __FILE__)
2
+ require 'uri'
3
+
4
+ describe "URI::MailTo#set_to" do
5
+ it "needs to be reviewed for spec completeness"
6
+ end
@@ -0,0 +1,6 @@
1
+ require File.expand_path('../../../../spec_helper', __FILE__)
2
+ require 'uri'
3
+
4
+ describe "URI::MailTo#to_mailtext" do
5
+ it "needs to be reviewed for spec completeness"
6
+ end
@@ -0,0 +1,6 @@
1
+ require File.expand_path('../../../../spec_helper', __FILE__)
2
+ require 'uri'
3
+
4
+ describe "URI::MailTo#to_rfc822text" do
5
+ it "needs to be reviewed for spec completeness"
6
+ end
@@ -0,0 +1,6 @@
1
+ require File.expand_path('../../../../spec_helper', __FILE__)
2
+ require 'uri'
3
+
4
+ describe "URI::MailTo#to_s" do
5
+ it "needs to be reviewed for spec completeness"
6
+ end
@@ -0,0 +1,10 @@
1
+ require File.expand_path('../../../../spec_helper', __FILE__)
2
+ require 'uri'
3
+
4
+ describe "URI::MailTo#to" do
5
+ it "needs to be reviewed for spec completeness"
6
+ end
7
+
8
+ describe "URI::MailTo#to=" 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)