vagrant-unbundled 2.0.0.1 → 2.0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (351) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/CHANGELOG.md +34 -0
  4. data/Gemfile.lock +10 -10
  5. data/README.md +2 -2
  6. data/contrib/sudoers/linux-suse +6 -7
  7. data/lib/vagrant/plugin/v2/command.rb +3 -0
  8. data/lib/vagrant/plugin/v2/communicator.rb +1 -1
  9. data/lib/vagrant/registry.rb +1 -1
  10. data/lib/vagrant/util/downloader.rb +1 -2
  11. data/lib/vagrant/util/is_port_open.rb +2 -1
  12. data/lib/vagrant/util/keypair.rb +1 -1
  13. data/lib/vagrant/util/platform.rb +39 -23
  14. data/plugins/commands/destroy/command.rb +31 -10
  15. data/plugins/communicators/ssh/communicator.rb +1 -0
  16. data/plugins/communicators/winrm/helper.rb +6 -1
  17. data/plugins/guests/solaris11/cap/change_host_name.rb +0 -2
  18. data/plugins/guests/solaris11/cap/configure_networks.rb +1 -7
  19. data/plugins/guests/solaris11/plugin.rb +5 -35
  20. data/plugins/guests/windows/cap/public_key.rb +2 -0
  21. data/plugins/guests/windows/guest_network.rb +3 -3
  22. data/plugins/guests/windows/scripts/reboot_detect.ps1 +5 -0
  23. data/plugins/providers/docker/driver.rb +1 -1
  24. data/plugins/providers/docker/executor/local.rb +4 -0
  25. data/plugins/providers/docker/executor/vagrant.rb +4 -0
  26. data/plugins/providers/hyperv/scripts/import_vm_vmcx.ps1 +1 -1
  27. data/plugins/providers/virtualbox/driver/meta.rb +1 -0
  28. data/plugins/providers/virtualbox/driver/version_5_2.rb +16 -0
  29. data/plugins/providers/virtualbox/plugin.rb +1 -0
  30. data/plugins/providers/virtualbox/synced_folder.rb +1 -1
  31. data/plugins/provisioners/chef/provisioner/chef_client.rb +30 -23
  32. data/plugins/provisioners/chef/provisioner/chef_solo.rb +26 -19
  33. data/plugins/provisioners/chef/provisioner/chef_zero.rb +29 -22
  34. data/plugins/provisioners/puppet/provisioner/puppet.rb +23 -4
  35. data/plugins/provisioners/salt/bootstrap-salt.ps1 +15 -3
  36. data/plugins/provisioners/salt/bootstrap-salt.sh +2 -0
  37. data/plugins/provisioners/salt/config.rb +11 -0
  38. data/plugins/provisioners/salt/provisioner.rb +10 -7
  39. data/plugins/provisioners/shell/provisioner.rb +1 -1
  40. data/templates/locales/en.yml +5 -0
  41. data/test/unit/base.rb +2 -0
  42. data/test/unit/plugins/commands/destroy/command_test.rb +155 -0
  43. data/test/unit/plugins/communicators/winrm/helper_test.rb +33 -0
  44. data/test/unit/plugins/guests/solaris11/cap/change_host_name_test.rb +36 -0
  45. data/test/unit/plugins/guests/solaris11/cap/configure_networks_test.rb +56 -0
  46. data/test/unit/plugins/providers/virtualbox/synced_folder_test.rb +26 -0
  47. data/test/unit/plugins/provisioners/salt/config_test.rb +42 -0
  48. data/test/unit/plugins/provisioners/salt/provisioner_test.rb +16 -1
  49. data/test/unit/plugins/provisioners/shell/config_test.rb +3 -3
  50. data/test/unit/plugins/pushes/local-exec/config_test.rb +2 -2
  51. data/test/unit/vagrant/util/downloader_test.rb +28 -0
  52. data/test/unit/vagrant/util/platform_test.rb +58 -0
  53. data/vagrant.gemspec +1 -1
  54. data/vendor/bundle/ruby/2.4.0/bin/rwinrmcp +5 -0
  55. data/vendor/bundle/ruby/2.4.0/bin/vagrant +5 -0
  56. data/vendor/bundle/ruby/2.4.0/bin/vagrant-spec +5 -0
  57. data/vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/vagrant-spec.gemspec +3 -3
  58. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/CHANGELOG.md +216 -0
  59. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/Gemfile +32 -0
  60. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/LICENSE.txt +202 -0
  61. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/README.md +121 -0
  62. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/Rakefile +32 -0
  63. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/data/unicode.data +0 -0
  64. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/lib/addressable/idna/native.rb +59 -0
  65. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/lib/addressable/idna/pure.rb +677 -0
  66. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/lib/addressable/idna.rb +25 -0
  67. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/lib/addressable/template.rb +1065 -0
  68. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/lib/addressable/uri.rb +2492 -0
  69. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/lib/addressable/version.rb +30 -0
  70. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/lib/addressable.rb +2 -0
  71. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/spec/addressable/idna_spec.rb +298 -0
  72. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/spec/addressable/net_http_compat_spec.rb +28 -0
  73. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/spec/addressable/rack_mount_compat_spec.rb +104 -0
  74. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/spec/addressable/security_spec.rb +57 -0
  75. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/spec/addressable/template_spec.rb +1419 -0
  76. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/spec/addressable/uri_spec.rb +6468 -0
  77. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/spec/spec_helper.rb +21 -0
  78. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/tasks/clobber.rake +2 -0
  79. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/tasks/gem.rake +91 -0
  80. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/tasks/git.rake +45 -0
  81. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/tasks/metrics.rake +22 -0
  82. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/tasks/rspec.rake +21 -0
  83. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.5.2/tasks/yard.rake +27 -0
  84. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/.gitignore +15 -0
  85. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/.rspec +1 -0
  86. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/.travis.yml +13 -0
  87. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/.yardopts +1 -0
  88. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/Gemfile +6 -0
  89. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/LICENSE +19 -0
  90. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/README.md +265 -0
  91. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/Rakefile +13 -0
  92. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/changelog.md +72 -0
  93. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/hashdiff.gemspec +25 -0
  94. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/lib/hashdiff/diff.rb +232 -0
  95. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/lib/hashdiff/lcs.rb +69 -0
  96. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/lib/hashdiff/linear_compare_array.rb +155 -0
  97. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/lib/hashdiff/patch.rb +88 -0
  98. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/lib/hashdiff/util.rb +146 -0
  99. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/lib/hashdiff/version.rb +3 -0
  100. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/lib/hashdiff.rb +6 -0
  101. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/spec/hashdiff/best_diff_spec.rb +74 -0
  102. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/spec/hashdiff/diff_array_spec.rb +60 -0
  103. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/spec/hashdiff/diff_spec.rb +339 -0
  104. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/spec/hashdiff/lcs_spec.rb +75 -0
  105. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/spec/hashdiff/linear_compare_array_spec.rb +48 -0
  106. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/spec/hashdiff/patch_spec.rb +183 -0
  107. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/spec/hashdiff/util_spec.rb +78 -0
  108. data/vendor/bundle/ruby/2.4.0/gems/hashdiff-0.3.7/spec/spec_helper.rb +13 -0
  109. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/CHANGELOG.md +250 -0
  110. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/CONTRIBUTING.md +46 -0
  111. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/LICENSE.md +20 -0
  112. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/README.md +122 -0
  113. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapter.rb +49 -0
  114. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapter_error.rb +15 -0
  115. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/gson.rb +20 -0
  116. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/jr_jackson.rb +25 -0
  117. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/json_common.rb +23 -0
  118. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/json_gem.rb +11 -0
  119. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/json_pure.rb +11 -0
  120. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/nsjsonserialization.rb +32 -0
  121. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/oj.rb +25 -0
  122. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/ok_json.rb +23 -0
  123. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/adapters/yajl.rb +19 -0
  124. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/convertible_hash_keys.rb +43 -0
  125. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/options.rb +39 -0
  126. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/options_cache.rb +29 -0
  127. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/parse_error.rb +17 -0
  128. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/vendor/okjson.rb +606 -0
  129. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json/version.rb +17 -0
  130. data/vendor/bundle/ruby/2.4.0/gems/multi_json-1.12.2/lib/multi_json.rb +161 -0
  131. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/.gitignore +11 -0
  132. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/.rubocop.yml +32 -0
  133. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/.rubocop_defaults.yml +177 -0
  134. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/.travis.yml +24 -0
  135. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/.yardopts +1 -0
  136. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/2.0-Upgrade.md +52 -0
  137. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/CHANGELOG.md +330 -0
  138. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/Gemfile +10 -0
  139. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/LICENSE.txt +22 -0
  140. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/README.md +202 -0
  141. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/Rakefile +49 -0
  142. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/bin/console +14 -0
  143. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/data/list.txt +12288 -0
  144. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/lib/public_suffix/domain.rb +235 -0
  145. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/lib/public_suffix/errors.rb +39 -0
  146. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/lib/public_suffix/list.rb +243 -0
  147. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/lib/public_suffix/rule.rb +348 -0
  148. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/lib/public_suffix/version.rb +10 -0
  149. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/lib/public_suffix.rb +175 -0
  150. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/public_suffix.gemspec +25 -0
  151. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/.empty +2 -0
  152. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/acceptance_test.rb +127 -0
  153. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/benchmarks/bm_find.rb +66 -0
  154. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/benchmarks/bm_find_all.rb +102 -0
  155. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/benchmarks/bm_names.rb +91 -0
  156. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/benchmarks/bm_select.rb +26 -0
  157. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/benchmarks/bm_select_incremental.rb +25 -0
  158. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/benchmarks/bm_valid.rb +101 -0
  159. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/profilers/domain_profiler.rb +12 -0
  160. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/profilers/find_profiler.rb +12 -0
  161. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/profilers/find_profiler_jp.rb +12 -0
  162. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/profilers/initialization_profiler.rb +11 -0
  163. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/profilers/list_profsize.rb +11 -0
  164. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/profilers/object_binsize.rb +57 -0
  165. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/psl_test.rb +49 -0
  166. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/test_helper.rb +13 -0
  167. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/tests.txt +98 -0
  168. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/unit/domain_test.rb +104 -0
  169. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/unit/errors_test.rb +23 -0
  170. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/unit/list_test.rb +239 -0
  171. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/unit/public_suffix_test.rb +186 -0
  172. data/vendor/bundle/ruby/2.4.0/gems/public_suffix-3.0.1/test/unit/rule_test.rb +220 -0
  173. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/.gemtest +0 -0
  174. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/.gitignore +34 -0
  175. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/.rspec-tm +2 -0
  176. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/.travis.yml +24 -0
  177. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/CHANGELOG.md +1460 -0
  178. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/Gemfile +9 -0
  179. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/LICENSE +20 -0
  180. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/README.md +1045 -0
  181. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/Rakefile +30 -0
  182. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/api.rb +97 -0
  183. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/assertion_failure.rb +11 -0
  184. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/callback_registry.rb +35 -0
  185. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/config.rb +18 -0
  186. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/cucumber.rb +10 -0
  187. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/deprecation.rb +9 -0
  188. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/errors.rb +17 -0
  189. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/curb_adapter.rb +337 -0
  190. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +228 -0
  191. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/excon_adapter.rb +162 -0
  192. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/http_lib_adapter.rb +7 -0
  193. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +19 -0
  194. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/http_rb/client.rb +14 -0
  195. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/http_rb/request.rb +10 -0
  196. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/http_rb/response.rb +43 -0
  197. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/http_rb/streamer.rb +25 -0
  198. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/http_rb/webmock.rb +68 -0
  199. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/http_rb_adapter.rb +37 -0
  200. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/httpclient_adapter.rb +240 -0
  201. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/manticore_adapter.rb +127 -0
  202. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/net_http.rb +362 -0
  203. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/net_http_response.rb +34 -0
  204. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/patron_adapter.rb +130 -0
  205. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +174 -0
  206. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/matchers/hash_including_matcher.rb +36 -0
  207. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/minitest.rb +41 -0
  208. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/rack_response.rb +69 -0
  209. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/request_body_diff.rb +64 -0
  210. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/request_execution_verifier.rb +78 -0
  211. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/request_pattern.rb +343 -0
  212. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/request_registry.rb +35 -0
  213. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/request_signature.rb +54 -0
  214. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/request_signature_snippet.rb +61 -0
  215. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/request_stub.rb +100 -0
  216. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/response.rb +153 -0
  217. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/responses_sequence.rb +40 -0
  218. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/request_pattern_matcher.rb +78 -0
  219. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb +52 -0
  220. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers.rb +27 -0
  221. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/rspec.rb +35 -0
  222. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/stub_registry.rb +67 -0
  223. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/stub_request_snippet.rb +34 -0
  224. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/test_unit.rb +22 -0
  225. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/util/hash_counter.rb +32 -0
  226. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/util/hash_keys_stringifier.rb +25 -0
  227. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/util/hash_validator.rb +17 -0
  228. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/util/headers.rb +49 -0
  229. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/util/json.rb +78 -0
  230. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/util/query_mapper.rb +279 -0
  231. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/util/uri.rb +111 -0
  232. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/util/version_checker.rb +111 -0
  233. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/version.rb +3 -0
  234. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/webmock.rb +156 -0
  235. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock.rb +54 -0
  236. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/minitest/test_helper.rb +34 -0
  237. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/minitest/test_webmock.rb +9 -0
  238. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/minitest/webmock_spec.rb +60 -0
  239. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/curb/curb_spec.rb +466 -0
  240. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/curb/curb_spec_helper.rb +147 -0
  241. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/em_http_request/em_http_request_spec.rb +406 -0
  242. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +77 -0
  243. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/excon/excon_spec.rb +75 -0
  244. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/excon/excon_spec_helper.rb +50 -0
  245. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/http_rb/http_rb_spec.rb +73 -0
  246. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/http_rb/http_rb_spec_helper.rb +51 -0
  247. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/httpclient/httpclient_spec.rb +209 -0
  248. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/httpclient/httpclient_spec_helper.rb +57 -0
  249. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/manticore/manticore_spec.rb +56 -0
  250. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/manticore/manticore_spec_helper.rb +35 -0
  251. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/net_http/net_http_shared.rb +142 -0
  252. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/net_http/net_http_spec.rb +317 -0
  253. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/net_http/net_http_spec_helper.rb +64 -0
  254. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/net_http/real_net_http_spec.rb +20 -0
  255. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/patron/patron_spec.rb +118 -0
  256. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/patron/patron_spec_helper.rb +54 -0
  257. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +313 -0
  258. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/shared/callbacks.rb +147 -0
  259. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/shared/complex_cross_concern_behaviors.rb +36 -0
  260. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/shared/enabling_and_disabling_webmock.rb +95 -0
  261. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/shared/precedence_of_stubs.rb +15 -0
  262. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/shared/request_expectations.rb +916 -0
  263. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/shared/returning_declared_responses.rb +388 -0
  264. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/shared/stubbing_requests.rb +583 -0
  265. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +135 -0
  266. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +60 -0
  267. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/acceptance/webmock_shared.rb +41 -0
  268. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/fixtures/test.txt +1 -0
  269. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/quality_spec.rb +84 -0
  270. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/spec_helper.rb +48 -0
  271. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/support/example_curl_output.txt +22 -0
  272. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/support/failures.rb +9 -0
  273. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/support/my_rack_app.rb +53 -0
  274. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/support/network_connection.rb +19 -0
  275. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/support/webmock_server.rb +69 -0
  276. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/api_spec.rb +75 -0
  277. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/errors_spec.rb +129 -0
  278. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +17 -0
  279. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +12 -0
  280. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/matchers/hash_including_matcher_spec.rb +87 -0
  281. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/rack_response_spec.rb +112 -0
  282. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/request_body_diff_spec.rb +90 -0
  283. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/request_execution_verifier_spec.rb +208 -0
  284. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/request_pattern_spec.rb +590 -0
  285. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/request_registry_spec.rb +76 -0
  286. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/request_signature_snippet_spec.rb +89 -0
  287. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/request_signature_spec.rb +155 -0
  288. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/request_stub_spec.rb +199 -0
  289. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/response_spec.rb +282 -0
  290. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/stub_registry_spec.rb +103 -0
  291. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/stub_request_snippet_spec.rb +95 -0
  292. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/util/hash_counter_spec.rb +39 -0
  293. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/util/hash_keys_stringifier_spec.rb +27 -0
  294. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/util/headers_spec.rb +28 -0
  295. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/util/json_spec.rb +33 -0
  296. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/util/query_mapper_spec.rb +138 -0
  297. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/util/uri_spec.rb +299 -0
  298. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/util/version_checker_spec.rb +65 -0
  299. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/spec/unit/webmock_spec.rb +11 -0
  300. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/test/http_request.rb +24 -0
  301. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/test/shared_test.rb +95 -0
  302. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/test/test_helper.rb +23 -0
  303. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/test/test_webmock.rb +6 -0
  304. data/vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/webmock.gemspec +46 -0
  305. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/.gitignore +11 -0
  306. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/.rspec +3 -0
  307. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/.rubocop.yml +9 -0
  308. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/.travis.yml +9 -0
  309. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/Gemfile +5 -0
  310. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/LICENSE +202 -0
  311. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/README.md +79 -0
  312. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/Rakefile +28 -0
  313. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/VERSION +1 -0
  314. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/Vagrantfile +9 -0
  315. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/appveyor.yml +38 -0
  316. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/bin/rwinrmcp +86 -0
  317. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/changelog.md +60 -0
  318. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/core/file_transporter.rb +527 -0
  319. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/core/tmp_zip.rb +177 -0
  320. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/exceptions.rb +28 -0
  321. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/file_manager.rb +118 -0
  322. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/scripts/check_files.ps1.erb +49 -0
  323. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/scripts/checksum.ps1.erb +13 -0
  324. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/scripts/create_dir.ps1.erb +6 -0
  325. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/scripts/delete.ps1.erb +6 -0
  326. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/scripts/download.ps1.erb +8 -0
  327. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/scripts/exists.ps1.erb +10 -0
  328. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/scripts/extract_files.ps1.erb +52 -0
  329. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs/scripts/scripts.rb +31 -0
  330. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/lib/winrm-fs.rb +28 -0
  331. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/spec/config-example.yml +3 -0
  332. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/spec/integration/file_manager_spec.rb +224 -0
  333. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/spec/integration/tmp_zip_spec.rb +26 -0
  334. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/spec/matchers.rb +58 -0
  335. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/spec/spec_helper.rb +71 -0
  336. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/spec/unit/tmp_zip_spec.rb +79 -0
  337. data/vendor/bundle/ruby/2.4.0/gems/winrm-fs-1.1.1/winrm-fs.gemspec +37 -0
  338. data/vendor/bundle/ruby/2.4.0/specifications/addressable-2.5.2.gemspec +39 -0
  339. data/vendor/bundle/ruby/2.4.0/specifications/hashdiff-0.3.7.gemspec +39 -0
  340. data/vendor/bundle/ruby/2.4.0/specifications/multi_json-1.12.2.gemspec +33 -0
  341. data/vendor/bundle/ruby/2.4.0/specifications/public_suffix-3.0.1.gemspec +41 -0
  342. data/vendor/bundle/ruby/2.4.0/specifications/webmock-2.3.2.gemspec +79 -0
  343. data/vendor/bundle/ruby/2.4.0/specifications/winrm-fs-1.1.1.gemspec +57 -0
  344. data/version.txt +1 -1
  345. metadata +295 -11
  346. data/plugins/guests/solaris11/cap/halt.rb +0 -26
  347. data/plugins/guests/solaris11/cap/insert_public_key.rb +0 -21
  348. data/plugins/guests/solaris11/cap/mount_virtualbox_shared_folder.rb +0 -45
  349. data/plugins/guests/solaris11/cap/remove_public_key.rb +0 -21
  350. data/plugins/guests/solaris11/cap/rsync.rb +0 -29
  351. data/test/unit/plugins/guests/solaris11/cap/halt_test.rb +0 -44
@@ -0,0 +1,220 @@
1
+ require "test_helper"
2
+
3
+ class PublicSuffix::RuleTest < Minitest::Test
4
+
5
+ def test_factory_should_return_rule_normal
6
+ rule = PublicSuffix::Rule.factory("com")
7
+ assert_instance_of PublicSuffix::Rule::Normal, rule
8
+
9
+ rule = PublicSuffix::Rule.factory("verona.it")
10
+ assert_instance_of PublicSuffix::Rule::Normal, rule
11
+ end
12
+
13
+ def test_factory_should_return_rule_exception
14
+ rule = PublicSuffix::Rule.factory("!british-library.uk")
15
+ assert_instance_of PublicSuffix::Rule::Exception, rule
16
+ end
17
+
18
+ def test_factory_should_return_rule_wildcard
19
+ rule = PublicSuffix::Rule.factory("*.do")
20
+ assert_instance_of PublicSuffix::Rule::Wildcard, rule
21
+
22
+ rule = PublicSuffix::Rule.factory("*.sch.uk")
23
+ assert_instance_of PublicSuffix::Rule::Wildcard, rule
24
+ end
25
+
26
+
27
+ def test_default_returns_default_wildcard
28
+ default = PublicSuffix::Rule.default
29
+ assert_equal PublicSuffix::Rule::Wildcard.build("*"), default
30
+ assert_equal %w( example tldnotlisted ), default.decompose("example.tldnotlisted")
31
+ assert_equal %w( www.example tldnotlisted ), default.decompose("www.example.tldnotlisted")
32
+ end
33
+
34
+ end
35
+
36
+
37
+ class PublicSuffix::RuleBaseTest < Minitest::Test
38
+
39
+ class ::PublicSuffix::Rule::Test < ::PublicSuffix::Rule::Base
40
+ end
41
+
42
+ def setup
43
+ @klass = PublicSuffix::Rule::Base
44
+ end
45
+
46
+
47
+ def test_initialize
48
+ rule = @klass.new(value: "verona.it")
49
+ assert_instance_of @klass, rule
50
+ assert_equal "verona.it", rule.value
51
+ end
52
+
53
+
54
+ def test_equality_with_self
55
+ rule = PublicSuffix::Rule::Base.new(value: "foo")
56
+ assert_equal rule, rule
57
+ end
58
+
59
+ # rubocop:disable Style/SingleLineMethods
60
+ def test_equality_with_internals
61
+ assert_equal @klass.new(value: "foo"), @klass.new(value: "foo")
62
+ refute_equal @klass.new(value: "foo"), @klass.new(value: "bar")
63
+ refute_equal @klass.new(value: "foo"), PublicSuffix::Rule::Test.new(value: "foo")
64
+ refute_equal @klass.new(value: "foo"), PublicSuffix::Rule::Test.new(value: "bar")
65
+ refute_equal @klass.new(value: "foo"), Class.new { def name; foo; end }.new
66
+ end
67
+ # rubocop:enable Style/SingleLineMethods
68
+
69
+ def test_match
70
+ [
71
+ # standard match
72
+ [PublicSuffix::Rule.factory("uk"), "uk", true],
73
+ [PublicSuffix::Rule.factory("uk"), "example.uk", true],
74
+ [PublicSuffix::Rule.factory("uk"), "example.co.uk", true],
75
+ [PublicSuffix::Rule.factory("co.uk"), "example.co.uk", true],
76
+
77
+ # FIXME
78
+ # [PublicSuffix::Rule.factory("*.com"), "com", false],
79
+ [PublicSuffix::Rule.factory("*.com"), "example.com", true],
80
+ [PublicSuffix::Rule.factory("*.com"), "foo.example.com", true],
81
+ [PublicSuffix::Rule.factory("!example.com"), "com", false],
82
+ [PublicSuffix::Rule.factory("!example.com"), "example.com", true],
83
+ [PublicSuffix::Rule.factory("!example.com"), "foo.example.com", true],
84
+
85
+ # TLD mismatch
86
+ [PublicSuffix::Rule.factory("gk"), "example.uk", false],
87
+ [PublicSuffix::Rule.factory("gk"), "example.co.uk", false],
88
+ [PublicSuffix::Rule.factory("co.uk"), "uk", false],
89
+
90
+ # general mismatch
91
+ [PublicSuffix::Rule.factory("uk.co"), "example.co.uk", false],
92
+ [PublicSuffix::Rule.factory("go.uk"), "example.co.uk", false],
93
+ [PublicSuffix::Rule.factory("co.uk"), "uk", false],
94
+
95
+ # partial matches/mismatches
96
+ [PublicSuffix::Rule.factory("co"), "example.co.uk", false],
97
+ [PublicSuffix::Rule.factory("example"), "example.uk", false],
98
+ [PublicSuffix::Rule.factory("le.it"), "example.it", false],
99
+ [PublicSuffix::Rule.factory("le.it"), "le.it", true],
100
+ [PublicSuffix::Rule.factory("le.it"), "foo.le.it", true],
101
+
102
+ ].each do |rule, input, expected|
103
+ assert_equal expected, rule.match?(input)
104
+ end
105
+ end
106
+
107
+
108
+ def test_parts
109
+ assert_raises(NotImplementedError) { @klass.new(value: "com").parts }
110
+ end
111
+
112
+ def test_decompose
113
+ assert_raises(NotImplementedError) { @klass.new(value: "com").decompose("google.com") }
114
+ end
115
+
116
+ end
117
+
118
+
119
+ class PublicSuffix::RuleNormalTest < Minitest::Test
120
+
121
+ def setup
122
+ @klass = PublicSuffix::Rule::Normal
123
+ end
124
+
125
+
126
+ def test_build
127
+ rule = @klass.build("verona.it")
128
+ assert_instance_of @klass, rule
129
+ assert_equal "verona.it", rule.value
130
+ assert_equal "verona.it", rule.rule
131
+ end
132
+
133
+
134
+ def test_length
135
+ assert_equal 1, @klass.build("com").length
136
+ assert_equal 2, @klass.build("co.com").length
137
+ assert_equal 3, @klass.build("mx.co.com").length
138
+ end
139
+
140
+ def test_parts
141
+ assert_equal %w(com), @klass.build("com").parts
142
+ assert_equal %w(co com), @klass.build("co.com").parts
143
+ assert_equal %w(mx co com), @klass.build("mx.co.com").parts
144
+ end
145
+
146
+ def test_decompose
147
+ assert_equal [nil, nil], @klass.build("com").decompose("com")
148
+ assert_equal %w( example com ), @klass.build("com").decompose("example.com")
149
+ assert_equal %w( foo.example com ), @klass.build("com").decompose("foo.example.com")
150
+ end
151
+
152
+ end
153
+
154
+
155
+ class PublicSuffix::RuleExceptionTest < Minitest::Test
156
+
157
+ def setup
158
+ @klass = PublicSuffix::Rule::Exception
159
+ end
160
+
161
+
162
+ def test_initialize
163
+ rule = @klass.build("!british-library.uk")
164
+ assert_instance_of @klass, rule
165
+ assert_equal "british-library.uk", rule.value
166
+ assert_equal "!british-library.uk", rule.rule
167
+ end
168
+
169
+
170
+ def test_length
171
+ assert_equal 2, @klass.build("!british-library.uk").length
172
+ assert_equal 3, @klass.build("!foo.british-library.uk").length
173
+ end
174
+
175
+ def test_parts
176
+ assert_equal %w( uk ), @klass.build("!british-library.uk").parts
177
+ assert_equal %w( tokyo jp ), @klass.build("!metro.tokyo.jp").parts
178
+ end
179
+
180
+ def test_decompose
181
+ assert_equal [nil, nil], @klass.build("!british-library.uk").decompose("uk")
182
+ assert_equal %w( british-library uk ), @klass.build("!british-library.uk").decompose("british-library.uk")
183
+ assert_equal %w( foo.british-library uk ), @klass.build("!british-library.uk").decompose("foo.british-library.uk")
184
+ end
185
+
186
+ end
187
+
188
+
189
+ class PublicSuffix::RuleWildcardTest < Minitest::Test
190
+
191
+ def setup
192
+ @klass = PublicSuffix::Rule::Wildcard
193
+ end
194
+
195
+
196
+ def test_initialize
197
+ rule = @klass.build("*.aichi.jp")
198
+ assert_instance_of @klass, rule
199
+ assert_equal "aichi.jp", rule.value
200
+ assert_equal "*.aichi.jp", rule.rule
201
+ end
202
+
203
+
204
+ def test_length
205
+ assert_equal 2, @klass.build("*.uk").length
206
+ assert_equal 3, @klass.build("*.co.uk").length
207
+ end
208
+
209
+ def test_parts
210
+ assert_equal %w( uk ), @klass.build("*.uk").parts
211
+ assert_equal %w( co uk ), @klass.build("*.co.uk").parts
212
+ end
213
+
214
+ def test_decompose
215
+ assert_equal [nil, nil], @klass.build("*.do").decompose("nic.do")
216
+ assert_equal %w( google co.uk ), @klass.build("*.uk").decompose("google.co.uk")
217
+ assert_equal %w( foo.google co.uk ), @klass.build("*.uk").decompose("foo.google.co.uk")
218
+ end
219
+
220
+ end
@@ -0,0 +1,34 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ .*.sw[a-z]
15
+
16
+ ## RubyMine and related
17
+ .idea
18
+
19
+ ## PROJECT::GENERAL
20
+ coverage
21
+ rdoc
22
+ pkg
23
+
24
+ ## PROJECT::SPECIFIC
25
+ *.gem
26
+ .bundle
27
+ Gemfile.lock
28
+ gemfiles/*.gemfile.lock
29
+ pkg/*
30
+ tmp/*
31
+ *.rbc
32
+ *.rbx
33
+ .ruby-gemset
34
+ .ruby-version
@@ -0,0 +1,2 @@
1
+ --rspec-version 2.0.0
2
+ --bundler
@@ -0,0 +1,24 @@
1
+ rvm:
2
+ - 1.9.3
3
+ - 2.0.0
4
+ - 2.1.0
5
+ - 2.2.1
6
+ - 2.2.3
7
+ - 2.3.0
8
+ - 2.4.0
9
+ - rbx-2
10
+ - ruby-head
11
+ - jruby-9.0.0.0
12
+ - jruby-9.0.1.0
13
+ - jruby-19mode
14
+ - jruby
15
+ - jruby-head
16
+ matrix:
17
+ allow_failures:
18
+ - rvm: jruby-9.0.0.0
19
+ - rvm: jruby-head
20
+ - rvm: ruby-head
21
+ - rvm: rbx-2
22
+ # Send builds to container-based infrastructure
23
+ # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
24
+ sudo: false
@@ -0,0 +1,1460 @@
1
+ # Changelog
2
+
3
+ ## 2.3.2
4
+
5
+ * Restored support for Ruby 1.9.3 to comply with semantic versioning.
6
+
7
+ Thanks to [Jordan Harband](https://github.com/ljharb) for reporting the problem.
8
+
9
+ ## 2.3.1
10
+
11
+ * Added support for Ruby 2.4
12
+
13
+ Thanks to [Koichi ITO](https://github.com/koic)
14
+
15
+ * Dropped support for Ruby 1.9.3
16
+
17
+ ## 2.2.0
18
+
19
+ * Added `refute_requested` as an alias for `assert_not_requested`
20
+
21
+ Thanks to [Michael Grosser](https://github.com/grosser)
22
+
23
+ * Raising `Net::OpenTimeout` instead of `Timeout::Error` if available when a request stub is declared `to_timeout`
24
+
25
+ Thanks to [Gabe Martin-Dempesy](https://github.com/gabetax)
26
+
27
+ ## 2.1.1
28
+
29
+ * Added support for handling status messages in Excon responses.
30
+
31
+ Thanks to [Tero Marttila](https://github.com/SpComb) for reporting the issue.
32
+
33
+ ## 2.1.0
34
+
35
+ * Added support for `on_debug` callback in Curb.
36
+
37
+ Thanks to [Pavel Jurašek](https://github.com/pavel-jurasek-bcgdv-com)
38
+
39
+ * Added support for PATCH requests using Curb.
40
+
41
+ Thanks to [Pavel Jurašek](https://github.com/pavel-jurasek-bcgdv-com)
42
+
43
+ ## 2.0.3
44
+
45
+ * Handling headers passed as an Array to Curl::Easy
46
+
47
+ Thanks to [Chelsea](https://github.com/grosscr) for reporting the issue.
48
+
49
+ * Removed Ruby warnings.
50
+
51
+ Thanks to [Aaron Kromer](https://github.com/cupakromer)
52
+
53
+ ## 2.0.2
54
+
55
+ * Using `Base64.strict_encode64` instead of `Base64.encode64` to handle long user:pass basic auth credentials
56
+
57
+ Thanks to [Jonathan Schatz](https://github.com/modosc)
58
+
59
+ * Fixed handling of Authorisation header provided as string instead of array when using em-http-request.
60
+
61
+ Thanks to [Michael Richardson](https://github.com/TTransmit) for reporing the issue.
62
+
63
+ * Ensured `WebMock.net_connect_explicit_allowed?` always returns boolean.
64
+
65
+ Thanks tp [Jose Luis Honorato](https://github.com/jlhonora)
66
+
67
+ ## 2.0.1
68
+
69
+ * Added code responsible for loading em-http-request if available, which has been removed by mistake.
70
+
71
+ Thanks to [Vasiliy](https://github.com/304)
72
+
73
+ * WebMock loads "base64" if it's not yet loaded.
74
+
75
+ Thanks to [Taiki Ono](https://github.com/taiki45).
76
+
77
+ ## 2.0.0
78
+
79
+ * `require 'webmock'` does not enable WebMock anymore. `gem 'webmock'` can now be safely added to a Gemfile and no http client libs will be modified when it's loaded. Call `WebMock.enable!` to enable WebMock.
80
+
81
+ Please note that `require 'webmock/rspec'`, `require 'webmock/test_unit'`, `require 'webmock/minitest'` and `require 'webmock/cucumber'` still do enable WebMock.
82
+
83
+ * Dropped support for Ruby < 1.9.3
84
+
85
+ * Dropped support for em-http-request < 1.0.0
86
+
87
+ * WebMock 2.0 does not match basic authentication credentials in the userinfo part of the url, with credentials passed in `Authorization: Basic ...` header anymore.
88
+ It now treats the Authorization header and credentials in the userinfo part of a url as two completely separate attributes of a request.
89
+
90
+ The following stub declaration, which used to work in WebMock 1.x, is not going to work anymore
91
+
92
+ stub_request(:get, "user:pass@www.example.com")
93
+
94
+ Net::HTTP.start('www.example.com') do |http|
95
+ req = Net::HTTP::Get.new('/')
96
+ req.basic_auth 'user', 'pass'
97
+ http.request(req)
98
+ end # ===> Failure
99
+
100
+ In order to stub a request with basic authentication credentials provided in the Authorization header, please use the following code:
101
+
102
+ stub_request(:get, "www.example.com").with(basic_auth: ['user', 'pass'])
103
+
104
+ or
105
+
106
+ stub_request(:get, "www.example.com").
107
+ with(headers: 'Authorization' => "Basic #{ Base64.strict_encode64('user:pass').chomp}")
108
+
109
+ In order to stub a request with basic authentication credentials provided in the url, please use the following code:
110
+
111
+ stub_request(:get, "user:pass@www.example.com")
112
+
113
+ RestClient.get('user:pass@www.example.com') # ===> Success
114
+
115
+ ## 1.24.6
116
+
117
+ * Fixed issue with RUBY_VERSION comparison using old RubyGems.
118
+
119
+ Thanks to [Chris Griego](https://github.com/cgriego).
120
+
121
+ * Support for http.rb >= 2.0.0
122
+
123
+ ## 1.24.4
124
+
125
+ * Fixed the issue with parsing query to a hash with nested array i.e. `a[][b][]=one&a[][c][]=two`
126
+
127
+ Thanks to [Tim Diggins](https://github.com/timdiggins) for reporting the issue.
128
+ Thanks to [Cedric Pimenta](https://github.com/cedricpim) for finding the solution.
129
+
130
+ ## 1.24.3
131
+
132
+ * Allow Net:HTTP headers keys to be provided as symbols if `RUBY_VERSION` >= 2.3.0
133
+
134
+ Thanks to [Alex Kestner](https://github.com/akestner)
135
+
136
+ * Added a clear message on an attempt to match a multipart encoded request body.
137
+ WebMock doesn't support requests with multipart body... yet.
138
+
139
+ * `WebMock.disable_net_connect` `:allow` option, provided as regexp, matches https URIs correctly.
140
+
141
+ * `WebMock.disable_net_connect` `:allow` option can be set as a url string with scheme, host and port.
142
+
143
+ WebMock.disable_net_connect!(:allow => 'https://www.google.pl')
144
+
145
+ Thanks to [Gabriel Chaney](https://github.com/gabrieljoelc) for reporting the issue.
146
+
147
+ ## 1.24.2
148
+
149
+ * Improve parsing of params on request
150
+
151
+ Thanks to [Cedric Pimenta](https://github.com/cedricpim)
152
+
153
+ ## 1.24.1
154
+
155
+ * HTTPClient adapter supports reading basic authentication credentials directly from Authorization header.
156
+
157
+ Thanks to [Michiel Karnebeek](https://github.com/mkarnebeek)
158
+
159
+ ## 1.24.0
160
+
161
+ * Enabled support for Curb > 0.8.6
162
+
163
+ ## 1.23.0
164
+
165
+ * `WebMock.disable_net_connect` accepts `:allow` option with an object that responds to `#call`, receiving a `URI` object and returning a boolean:
166
+
167
+
168
+ blacklist = ['google.com', 'facebook.com', 'apple.com']
169
+ allowed_sites = lambda{|uri|
170
+ blacklist.none?{|site| uri.host.include?(site) }
171
+ }
172
+ WebMock.disable_net_connect!(:allow => allowed_sites)
173
+
174
+ RestClient.get('www.example.org', '/') # ===> Allowed
175
+ RestClient.get('www.facebook.com', '/') # ===> Failure
176
+ RestClient.get('apple.com', '/') # ===> Failure
177
+
178
+ Thanks to [Pablo Brasero](https://github.com/pablobm)
179
+
180
+ * Support for HTTPClient stream responses with body chunks
181
+
182
+ Thanks to [Cedric Pimenta](https://github.com/cedricpim)
183
+
184
+
185
+ ## 1.22.6
186
+
187
+ * Fixes [issue](https://github.com/bblimke/webmock/issues/568) around
188
+ WebMock restricting [Addressable](https://github.com/sporkmonger/addressable)
189
+ version, based on Ruby 1.8.7 for all versions of Ruby.
190
+
191
+ This change inverts that, and forces Ruby 1.8.7 users to specify in thier
192
+ Gemfile an Addressable version < 2.4.0.
193
+
194
+ Thanks to [PikachuEXE](https://github.com/PikachuEXE) and
195
+ [Matthew Rudy Jacobs](https://github.com/matthewrudy).
196
+
197
+ ## 1.22.5
198
+
199
+ * Fixes [bug](https://github.com/bblimke/webmock/issues/565) where WebMock tries
200
+ to alias a method that is deprecated in Ruby Versions > 1.9.2 ('sysread' for class 'StringIO')
201
+
202
+ Thanks to [Marcos Acosta](https://github.com/mmaa) for discovering this bug.
203
+
204
+ ## 1.22.4
205
+
206
+ * Adds support for JSONClient (a subclass of HTTPClient)
207
+
208
+ Thanks to [Andrew Kozin](https://github.com/nepalez)
209
+
210
+ * Adds support for Ruby 2.3.0
211
+
212
+ Thanks to [Charles Pence](https://github.com/cpence)
213
+
214
+ * Adds support for [http](https://github.com/httprb/http) versions >= 1.0.0
215
+
216
+ Thanks to [Alexey Zapparov](https://github.com/ixti)
217
+
218
+ * Fixes support for Ruby 1.8.7 by restrciting Addressable version < 2.4.0
219
+
220
+ Thanks to [Matthew Rudy Jacobs](https://github.com/matthewrudy)
221
+
222
+ ## 1.22.3
223
+
224
+ * Return "effective_url" attribute in Typhoeus::Response
225
+
226
+ Thanks to [Senya](https://github.com/cmrd-senya)
227
+
228
+ ## 1.22.2
229
+
230
+ * Fix: prevents adding an extra =true to urls with parameters without values
231
+
232
+ Thanks to [David Begin](https://github.com/davidbegin)
233
+
234
+ ## 1.22.1
235
+
236
+ * Adds Rack as a development dependency and removes require rack/utils in main lib.
237
+
238
+ Thanks to [Keenan Brock](https://github.com/kbrock)
239
+
240
+ ## 1.22.0
241
+
242
+ All the credit for preparing this release go to [David Begin](https://github.com/davidbegin)!
243
+
244
+ * Adds [Manticore](https://github.com/cheald/manticore) support.
245
+
246
+ Thanks to [Mike Knepper](https://github.com/mikeknep), [David Abdemoulaie](https://github.com/hobodave)
247
+
248
+ * Update to Show a hash diff for requests that have stubs with a body.
249
+
250
+ Thanks to [yurivm](https://github.com/yurivm)
251
+
252
+ * Update to mirror Net::HTTP handling of headers as symbols
253
+
254
+ * Update to ignore non-comparable-values error when sorting
255
+ query values, because sorting is just a convience.
256
+
257
+ Thanks to [Magne Land](https://github.com/magneland)
258
+
259
+ * Covert Boolean values to Strings when using them to define
260
+ the body of a request.
261
+
262
+ Thanks to [Krzysztof Rygielski](https://github.com/riggy)
263
+
264
+ * Fixes WebMock's parsing Multibyte characters
265
+
266
+ Thanks to [Zhao Wen](https://github.com/VincentZhao)
267
+
268
+ * Updates to be compatible with httpclient 2.6.0
269
+
270
+ * Converts keys from symbols to strings when for QueryMapper.to_query
271
+
272
+ Thanks to [Ramon Tayag](https://github.com/ramontayag)
273
+
274
+ * Restricts http.rb version to 0.7.3 for Ruby 1.8.7
275
+
276
+ * Fixes issue emulating em-http-request's handling of multiple requests.
277
+
278
+ Thanks to [Matt Palmer](https://github.com/mpalmer)
279
+
280
+ * WebMock requires only the necessary parts of crack to avoid pulling in safe_yaml
281
+
282
+ Thanks to [Johannes Schlumberger](https://github.com/spjsschl)
283
+
284
+ ## 1.21.0
285
+
286
+ * Support for http.rb >= 0.8.0
287
+
288
+ Thanks to [Zachary Anker](https://github.com/zanker), [Aleksey V. Zapparov](https://github.com/ixti)
289
+
290
+ * Support for http.rb 0.7.0
291
+
292
+ Thanks to [Mattias Putman](https://github.com/challengee)
293
+
294
+ * Added support for RSpec3-like `and_return`, `and_raise`, `and_timeout` syntax.
295
+
296
+ Thanks to [Franky Wahl](https://github.com/frankywahl)
297
+
298
+ * Restricted Curb support up to version 0.8.6. WebMock specs fail with Curb 0.8.7.
299
+
300
+ ## 1.20.4
301
+
302
+ * Fixed support for `hash_including` matcher in RSpec 3
303
+
304
+ ## 1.20.3
305
+
306
+ * `with` method raises error if provided without options hash and without block
307
+
308
+ * `with` and `to_return` raise an error if invoked with invalid keys in options hash.
309
+
310
+ ## 1.20.2
311
+
312
+ * WebMock provides a helpful error message if an incompatible object is given as response body.
313
+
314
+ Thanks to [Mark Lorenz](https://github.com/dapplebeforedawn)
315
+
316
+ ## 1.20.1
317
+
318
+ * `assert_requested` and `assert_not_requested` accept `at_least_times` and `at_most_times` options
319
+
320
+ Thanks to [Dan Buettner](https://github.com/Capncavedan)
321
+
322
+ * Silenced `instance variable undefined` warnings in Curb adapted.
323
+
324
+ Thanks to [Sven Riedel](https://github.com/sriedel)
325
+
326
+ ## 1.20.0
327
+
328
+ * Add support for on_missing callback of Curb::Easy
329
+
330
+ Thanks to [Tasos Stathopoulos](https://github.com/astathopoulos)
331
+
332
+ * Add at_least_times and at_most_times matchers
333
+
334
+ Thanks to [Dan Buettner](https://github.com/Capncavedan)
335
+
336
+ ## 1.19.0
337
+
338
+ * Fixed issue with Excon adapter giving warning message when redirects middleware was enabled.
339
+
340
+ Thanks to [Theo Hultberg](https://github.com/iconara) for reporting that.
341
+
342
+ * Fixed issue with `undefined method 'valid_request_keys' for Excon::Utils:Module`
343
+
344
+ Thanks to [Pablo Jairala](https://github.com/davidjairala)
345
+
346
+ * Fixed query mapper to encode `'one' => ['1','2']` as `'one[]=1&one[]=2'`.
347
+
348
+ Thanks to [Insoo Buzz Jung](https://github.com/insoul)
349
+
350
+ * Improved cookies support for em-http-request
351
+
352
+ Thanks to [Carlos Alonso Pérez](https://github.com/calonso)
353
+
354
+ * Fix HTTP Gem adapter to ensure uri attribute is set on response object.
355
+
356
+ Thanks to [Aleksey V. Zapparov](https://github.com/ixti)
357
+
358
+ * Fixed HTTPClient adapter. The response header now receives `request_method`, `request_uri`, and `request_query` transferred from request header
359
+
360
+ Thanks to [trlorenz](https://github.com/trlorenz)
361
+
362
+ * Query mapper supports nested data structures i.e. `{"first" => [{"two" => [{"three" => "four"}, "five"]}]}`
363
+
364
+ Thanks to [Alexander Simonov](https://github.com/simonoff)
365
+
366
+ * Fixed compatibility with latest versions of Excon which don't define `VALID_REQUEST_KEYS` anymore.
367
+
368
+ Thanks to [Pablo Jairala](https://github.com/davidjairala)
369
+
370
+ * Request method is always a symbol is request signatures. This fixes the issue of WebMock not matching Typhoeus requests with request method defined as string.
371
+
372
+ Thanks to [Thorbjørn Hermanse](https://github.com/thhermansen)
373
+
374
+ * Stubbing instructions which are displayed when no matching stub is found, can be disabled with `Config.instance.show_stubbing_instructions = false`
375
+
376
+ Thanks to [Mark Lorenz](https://github.com/dapplebeforedawn)
377
+
378
+ * Notation used for mapping query strings to data structure can be configured i.e. `WebMock::Config.instance.query_values_notation = :subscript`. This allows setting `:flat_array` notation which supports duplicated parameter names in query string.
379
+
380
+ Thanks to [tjsousa](https://github.com/tjsousa)
381
+
382
+ ## 1.18.0
383
+
384
+ * Updated dependency on Addressable to versions >= 2.3.6
385
+
386
+ * Added support for matching uris using RFC 6570 (URI Templates)
387
+
388
+ uri_template = Addressable::Template.new "www.example.com/{id}/"
389
+ stub_request(:any, uri_template)
390
+
391
+ Thanks to [Max Lincoln](https://github.com/maxlinc)
392
+
393
+ * Fixed content length calculation for Rack responses with UTF8 body
394
+
395
+ Thanks to [Oleg Gritsenko](https://github.com/Claster)
396
+
397
+ * Add missing Curl::Easy aliases
398
+
399
+ Thanks to [Hwan-Joon Choi](https://github.com/hc5duke)
400
+
401
+ * HTTP Gem >= 0.6.0 compatibility
402
+
403
+ Thanks to [Aleksey V. Zapparov](https://github.com/ixti)
404
+
405
+ * Minitest 4 and 5 compatibility.
406
+
407
+ Thanks to [SHIBATA Hiroshi](https://github.com/hsbt)
408
+
409
+ ## 1.17.4
410
+
411
+ * Update matchers for RSpec 3's matcher protocol
412
+
413
+ Thanks to [Rob Olson](https://github.com/robolson)
414
+
415
+ ## 1.17.3
416
+
417
+ * Fixed issue with Rack response removing 'Content-Type' header
418
+
419
+ Thanks to [Bo Jeanes](https://github.com/bjeanes) and [Matthew Conway](https://github.com/mattonrails)
420
+
421
+ ## 1.17.2
422
+
423
+ * Support for chunked responses in Curb
424
+
425
+ Thanks to [Zachary Belzer](https://github.com/zbelzer)
426
+
427
+ * Fixed handling of request body passed as a hash to `Typhoeus.post`
428
+
429
+ Thanks to [Mason Chang](https://github.com/changmason) for reporting.
430
+
431
+ ## 1.17.1
432
+
433
+ * Added missing license statements.
434
+
435
+ Thanks to [Praveen Arimbrathodiyil](https://github.com/pravi)
436
+
437
+ ## 1.17.0
438
+
439
+ * HTTP gem support!
440
+
441
+ Thanks to [Aleksey V. Zapparov](https://github.com/ixti)
442
+
443
+ * Limited Excon gem requirement to version < 0.30 until the compatibility with version > 0.30.0 is fixed.
444
+
445
+ Thanks to [Aleksey V. Zapparov](https://github.com/ixti)
446
+
447
+ * Fixed issue where empty query key caused a `TypeError`
448
+
449
+ Thanks to [Jon Rowe](https://github.com/JonRowe)
450
+
451
+ * Handling Typhoeus `on_headers` and `on_body` params.
452
+
453
+ Thanks to [Matt Burke](https://github.com/spraints)
454
+
455
+ ## 1.16.1
456
+
457
+ * Fixed "NameError: uninitialized constant WebMock::Response::Pathname" issue.
458
+
459
+ Thanks to [Alex Stupakow and Karen Wang](https://github.com/stupakov) for the fix.
460
+
461
+ ## 1.16.0
462
+
463
+ * Allow a Pathname to be passed as a Response body
464
+
465
+ stub_request(:get, /example.com/).to_return(
466
+ body: Rails.root.join('test/fixtures/foo.txt')
467
+ )
468
+
469
+ Thanks to [Ben Pickles](https://github.com/benpickles)
470
+
471
+ * `hash_including` matcher can be initialized with empty keys to match any values.
472
+
473
+ stub_request(:post, "www.example.com").with(:body => hash_including(:a, :b => {'c'}))
474
+ RestClient.post('www.example.com', '{"a":"1","b":"c"}', :content_type => 'application/json')
475
+
476
+ Thanks to [Stefano Uliari](https://github.com/steookk)
477
+
478
+ ## 1.15.2
479
+
480
+ * Fixed `hash_including` to accept a splat of solitary keys.
481
+
482
+ Thanks to [Tamir Duberstein](https://github.com/tamird) and [https://github.com/strongriley](https://github.com/strongriley)
483
+
484
+ ## 1.15.0
485
+
486
+ * Excon >= 0.27.5 compatibility.
487
+
488
+ Thanks to [Brian D. Burns](https://github.com/burns)
489
+
490
+ ## 1.14.0
491
+
492
+ * Handling non UTF-8 characters in query params.
493
+
494
+ Thanks to [Florian Dütsch](https://github.com/der-flo) for reporting the issue.
495
+
496
+ * Added support for `request_block` param in Excon
497
+
498
+ Thanks to [Dmitry Gutov](https://github.com/dgutov) for reporting the issue.
499
+
500
+ * Fixed compatibility with latest Curb
501
+
502
+ Thanks to [Ian Lesperance](https://github.com/elliterate) and [Matthew Horan](https://github.com/mhoran)
503
+
504
+ * Triggering errbacks assynchronously in em-http-request adapter.
505
+
506
+ Thanks to [Ian Lesperance](https://github.com/elliterate) and [Matthew Horan](https://github.com/mhoran)
507
+
508
+ * Handling query params with a hashes nested inside arrays.
509
+
510
+ Thanks to [Ian Asaff](https://github.com/montague)
511
+
512
+ * Changed NetConnectNotAllowedError to inherit from Exception to allow it to bubble up into a test suite.
513
+
514
+ Thanks to [Daniel van Hoesel](https://github.com/s0meone)
515
+
516
+ * HTTPClient adapter is thread safe.
517
+
518
+ Thanks to [Tom Beauvais](https://github.com/tbeauvais)
519
+
520
+ ## 1.13.0
521
+
522
+ * Net::HTTP::Persistent compatibility.
523
+ WebMock doesn't disconnect previously started connections upon a request anymore.
524
+
525
+
526
+ ## 1.12.3
527
+
528
+ * Fixed issue with handling Addressable::URI with query params passed to `Net::HTTP.get_response`
529
+
530
+ Thanks to [Leif Bladt](https://github.com/leifbladt)
531
+
532
+ * Fixed HTTPClient adapter to not raise an error if a request with multipart body is executed.
533
+
534
+ ## 1.12.2
535
+
536
+ * Fixed issue with handling request.path when Addressable::URI is passed to #request instead of URI with Ruby 2.0.
537
+
538
+ Thanks to [Leif Bladt](https://github.com/leifbladt)
539
+
540
+ * Accept integers as query param values in request stubs
541
+
542
+ i.e. `stub_request(:get, /.*/).with(:query => {"a" => 1})`
543
+
544
+ Thanks to [Mitsutaka Mimura](https://github.com/takkanm)
545
+
546
+ ## 1.12.1
547
+
548
+ * Fixed Minitest < 5.0 compatibility
549
+
550
+ Thanks to [Alex Tomlins](https://github.com/alext) for reporting the issue.
551
+
552
+ ## 1.12.0
553
+
554
+ * Not using Gem spec anymore to check loaded Curb version.
555
+
556
+ * `WebMock.disable_net_connect!` now accepts array of regexps as allow param:
557
+
558
+ i.e. `WebMock.disable_net_connect!(:allow => [/google.com/, /yahoo.com/])`
559
+
560
+ Thanks to [Bastien Vaucher](https://github.com/bastien)
561
+
562
+ * Fixed `on_header` Curb callback behaviour in Curb adapter
563
+
564
+ Thanks to [Joel Chippindale](https://github.com/mocoso)
565
+
566
+ * Fixed aws-sdk compatibility with Ruby 2.0, by supporting `continue_timeout` accessor on Net::HTTP socket.
567
+
568
+ Thanks to [Lin Jen-Shin](https://github.com/godfat)
569
+
570
+ * Fixed WebMock::Server to not give "log writing failed. can't be called from trap context" warning with Ruby 2.0
571
+
572
+ Thanks to [Murahashi Sanemat Kenichi](https://github.com/sanemat)
573
+
574
+ * Added support for EM-HTTP-Request streaming data off disk feature.
575
+
576
+ Thanks to [Lin Jen-Shin](https://github.com/godfat)
577
+
578
+ * Added compatibility with Minitest 5
579
+
580
+ Thanks to [Tim Kurvers](https://github.com/timkurvers)
581
+
582
+ * Excon >= 0.22 compatibility.
583
+
584
+ * README has nice sytnax hightlighting and fixed code styling!
585
+
586
+ Thanks to [Ilya Vassilevsky](https://github.com/vassilevsky)
587
+
588
+ * Compatibility with Rails 4 `rack.session.options`
589
+
590
+ Thanks to [gotwalt](https://github.com/gotwalt)
591
+
592
+ ## 1.11.0
593
+
594
+ * Excon >= 0.17 support.
595
+
596
+ Thanks to [Nathan Sutton](https://github.com/nate) for reporting this issue and to [Wesley Beary](https://github.com/geemus) and [Myron Marston](https://github.com/myronmarston) for help.
597
+
598
+ ## 1.10.2
599
+
600
+ * '+' in request path is treated as plus, but in query params always as a space.
601
+
602
+ ## 1.10.1
603
+
604
+ * '+' in request body is still treated as a space. This fixes a bug introduced in previous version.
605
+
606
+ Thanks to [Erik Michaels-Ober](https://github.com/sferik) for reporting this problem.
607
+
608
+ * Fixed issue: response body declared as Proc was not evaluated again on subsequent requests.
609
+
610
+ Thanks to [Rick Fletcher](https://github.com/rfletcher) for reporting this issue.
611
+
612
+ ## 1.10.0
613
+
614
+ * '+' in query params is not treated as space anymore and is encoded as %2B
615
+
616
+ Thanks to [goblin](https://github.com/goblin) for reporting this issue.
617
+
618
+ * added `remove_request_stub` method to the api to allow removing unused stubs i.e.
619
+
620
+ stub_get = stub_request(:get, "www.example.com")
621
+ remove_request_stub(stub_get)
622
+
623
+ * `assert_requested` and `assert_not_requested` raise an error if a stub object is provided together with a block.
624
+
625
+ ## 1.9.3
626
+
627
+ * Fixed issue with unavailable constant Mutex in Ruby < 1.9
628
+
629
+ Thanks to [Lucas Dohmen](https://github.com/moonglum) for reporting this issue.
630
+
631
+ ## 1.9.2
632
+
633
+ * Added support for Excon's :response_block parameter
634
+
635
+ Thanks to [Myron Marston](https://github.com/myronmarston) for reporting this issue.
636
+
637
+ ## 1.9.1
638
+
639
+ * Fix 'rack.errors' not being set for Rack apps
640
+
641
+ Thanks to [Alex Grant](https://github.com/grantovich)
642
+
643
+ * Added support for minitest assertions count
644
+
645
+ Thanks to [Mokevnin Kirill](https://github.com/mokevnin)
646
+
647
+ * Fixed issues with registering http requests in multi-threaded environments
648
+
649
+ Thanks to [Tom Beauvais](https://github.com/tbeauvais)
650
+
651
+ * Bumped Crack version to >=0.3.2
652
+
653
+ Thanks to [Jake Benilov](https://github.com/benilovj)
654
+
655
+ * Fixed issues in Typhoeus 0.6. Defaulted method to GET when no method specified.
656
+
657
+ Thanks to [Hans Hasselberg](https://github.com/i0rek)
658
+
659
+ * Add license information to the gemspec
660
+
661
+ Thanks to [Jordi Massaguer Pla](https://github.com/jordimassaguerpla) and [Murahashi Sanemat Kenichi](https://github.com/sanemat)
662
+
663
+ * Added support for :expects option in Excon adapter
664
+
665
+ Thanks to [Evgeniy Dolzhenko](https://github.com/dolzenko)
666
+
667
+ * Fixed Faye compatibility by treating StringIO in Net::HTTP adapter properly
668
+
669
+ Thanks to [Pavel Forkert](https://github.com/fxposter)
670
+
671
+ * Updated VCR link
672
+
673
+ Thanks to [Rex Feng](https://github.com/xta)
674
+
675
+ ## 1.9.0
676
+
677
+ * Added support for Typhoeus >= 0.5.0 and removed support for Typhoeus < 0.5.0.
678
+
679
+ Thanks to [Hans Hasselberg](https://github.com/i0rek)
680
+
681
+ ## 1.8.11
682
+
683
+ * Fix excon adapter to handle `:body => some_file_object`
684
+
685
+ Thanks to [Myron Marston](https://github.com/myronmarston)
686
+
687
+ ## 1.8.10
688
+
689
+ * em-http-request fix. After request callbacks are correctly invoked for 3xx responses,
690
+ when :redirects option is set.
691
+
692
+ Thanks to [Myron Marston](https://github.com/myronmarston) for reporting that issue.
693
+
694
+ * Fixed compatibility with Net::HTTP::DigestAuth
695
+
696
+ Thanks to [Jonathan Hyman](https://github.com/jonhyman) for reporting that issue.
697
+
698
+ * Fixed problem in em-http-request 0.x appending the query to the client URI twice.
699
+
700
+ Thanks to [Paweł Pierzchała](https://github.com/wrozka)
701
+
702
+ ## 1.8.9
703
+
704
+ * Fixed problem with caching nil responses when the same HTTPClient instance is used.
705
+
706
+ Thanks to [Myron Marston](https://github.com/myronmarston)
707
+
708
+ * Added support for Addressable >= 2.3.0. Addressable 2.3.0 removed support for multiple query value notations and broke backwards compatibility.
709
+
710
+ https://github.com/sporkmonger/addressable/commit/f51e290b5f68a98293327a7da84eb9e2d5f21c62
711
+ https://github.com/sporkmonger/addressable/issues/77
712
+
713
+
714
+ ## 1.8.8
715
+
716
+ * Fixed Net::HTTP adapter so that it returns `nil` for an empty body response.
717
+
718
+ Thanks to [Myron Marston](https://github.com/myronmarston)
719
+
720
+ * Gemspec defines compatibility with Addressable ~> 2.2.8, not >= 2.3.0
721
+
722
+ * Specs compatibility with Typhoeus 0.4.0
723
+
724
+ Thanks to [Hans Hasselberg](https://github.com/i0rek)
725
+
726
+ * Handling content types that specify a charset
727
+
728
+ Thanks to [Kevin Glowacz](https://github.com/kjg)
729
+
730
+ * Fixed em-http-request adapter to correctly fetch authorization header from a request
731
+
732
+ Thanks to [Julien Boyer](https://github.com/chatgris)
733
+
734
+ * Fixing travis-ci image to report master's status
735
+
736
+ Thanks to [Ryan Schlesinger](https://github.com/ryansch)
737
+
738
+ * Fixed problem with em-http-request callback triggering if there were other EM::Deferred callbacks registered
739
+
740
+ Thanks to [Jon Leighton](https://github.com/jonleighton)
741
+
742
+ * Fixed problem with em-http-request appending the query to the URI a second time, and
743
+ the parameters are repeated.
744
+
745
+ Thanks to [Jon Leighton](https://github.com/jonleighton)
746
+
747
+ ## 1.8.7
748
+
749
+ * Compatibility with RSpec >= 2.10
750
+
751
+ Thanks to [erwanlr](https://github.com/erwanlr) for reporting this issue.
752
+
753
+ * Add missing required rack environment variable SCRIPT_NAME
754
+
755
+ Thanks to [Eric Oestrich](https://github.com/oestrich)
756
+
757
+ * Fixed warnings due to @query_params not being initialized
758
+
759
+ Thanks to [Ben Bleything](https://github.com/bleything)
760
+
761
+ ## 1.8.6
762
+
763
+ * Pass through SERVER_PORT when stubbing to rack
764
+
765
+ Thanks to [Eric Oestrich](https://github.com/oestrich)
766
+
767
+ * Fixed problem with missing parenthesis in `WebMock#net_connect_allowed?` conditions.
768
+
769
+ Thanks to [aindustries](https://github.com/aindustries)
770
+
771
+ ## 1.8.5
772
+
773
+ * WebMock::RackResponse supports basic auth
774
+
775
+ Thanks to [jugyo](https://github.com/jugyo)
776
+
777
+ ## 1.8.4
778
+
779
+ * Warning message is printed when an unsupported version of a http library is loaded.
780
+
781
+ Thanks to [Alexander Staubo](https://github.com/alexstaubo) for reporting the problem and to [Myron Marston](https://github.com/myronmarston) for a help with solution.
782
+
783
+ ## 1.8.3
784
+
785
+ * Fixed compatibility with latest em-http-request
786
+
787
+ Thanks to [Paul Cortens](https://github.com/thoughtless)
788
+
789
+ ## 1.8.2
790
+
791
+ * Prevent Webmock `hash_including` from overriding RSpec version 1 `hash_including` method.
792
+
793
+ Thanks to [Joe Karayusuf](https://github.com/karayusuf)
794
+
795
+ * Ensured WebMock handles RSpec 1 `hash_including` matcher for matching query params and body.
796
+
797
+ ## 1.8.1
798
+
799
+ * Ensured WebMock doesn't interfere with `em-synchrony`, when `em-synchrony/em-http` is not included.
800
+
801
+ Thanks to [Nick Recobra](https://github.com/oruen)
802
+
803
+ * Improved README
804
+
805
+ Thanks to [Jordan Elver](https://github.com/jordelver)
806
+
807
+
808
+ ## 1.8.0
809
+
810
+ * Matching request body against partial hash.
811
+
812
+ stub_http_request(:post, "www.example.com").
813
+ with(:body => hash_including({:data => {:a => '1', :b => 'five'}}))
814
+
815
+ RestClient.post('www.example.com', "data[a]=1&data[b]=five&x=1",
816
+ :content_type => 'application/x-www-form-urlencoded') # ===> Success
817
+
818
+ request(:post, "www.example.com").
819
+ with(:body => hash_including({:data => {:a => '1', :b => 'five'}}),
820
+ :headers => 'Content-Type' => 'application/json').should have_been_made # ===> Success
821
+
822
+ Thanks to [Marnen Laibow-Koser](https://github.com/marnen) for help with this solution
823
+
824
+ * Matching request query params against partial hash.
825
+
826
+ stub_http_request(:get, "www.example.com").with(:query => hash_including({"a" => ["b", "c"]}))
827
+
828
+ RestClient.get("http://www.example.com/?a[]=b&a[]=c&x=1") # ===> Success
829
+
830
+ request(:get, "www.example.com").
831
+ with(:query => hash_including({"a" => ["b", "c"]})).should have_been_made # ===> Success
832
+
833
+ * Added support for Excon.
834
+
835
+ Thanks to [Dimitrij Denissenko](https://github.com/dim)
836
+
837
+ * Added support for setting expectations on the request stub with `assert_requested`
838
+
839
+ stub_get = stub_request(:get, "www.example.com")
840
+ stub_post = stub_request(:post, "www.example.com")
841
+
842
+ Net::HTTP.get('www.example.com', '/')
843
+
844
+ assert_requested(stub_get)
845
+ assert_not_requested(stub_post)
846
+
847
+ Thanks to [Nicolas Fouché](https://github.com/nfo)
848
+
849
+ * `WebMock.disable_net_connect!` accepts `RegExp` as `:allow` parameter
850
+
851
+ Thanks to [Frank Schumacher](https://github.com/thenoseman)
852
+
853
+ * Ensure multiple values for the same header can be recorded and played back
854
+
855
+ Thanks to [Myron Marston](https://github.com/myronmarston)
856
+
857
+ * Updated dependency on Addressable to version >= 2.2.7 to handle nested hash query values. I.e. `?one[two][three][]=four&one[two][three][]=five`
858
+
859
+ * Fixed compatibility with Curb >= 0.7.16 This breaks compatibility with Curb < 0.7.16
860
+
861
+ * Fix #to_rack to handle non-array response bodies.
862
+
863
+ Thanks to [Tammer Saleh](https://github.com/tsaleh)
864
+
865
+ * Added `read_timeout` accessor to StubSocket which fixes compatibility with aws-sdk
866
+
867
+ Thanks to [Lin Jen-Shin](https://github.com/godfat)
868
+
869
+ * Fix warning "instance variable @query_params not initialized"
870
+
871
+ Thanks to [Joe Van Dyk](https://github.com/joevandyk)
872
+
873
+ * Using bytesize of message instead of its length for content-length header in em-http-request adapter.
874
+ This fixes a problem with messages getting truncated in Ruby >= 1.9
875
+
876
+ Thanks to [Mark Abramov](https://github.com/markiz)
877
+
878
+ * Fixed problem with body params being matched even if params were different.
879
+
880
+ Thanks to [Evgeniy Dolzhenko](https://github.com/dolzenko) for reporting this issue.
881
+
882
+ ## 1.7.10
883
+
884
+ * Yanked 1.7.9 and rebuilt gem on 1.8.7 to deal with syck/psych incompatibilties in gemspec.
885
+
886
+ ## 1.7.9
887
+
888
+ * Fixed support for native Typhoeus timeouts.
889
+
890
+ Thanks to [Albert Llop](https://github.com/mrsimo)
891
+
892
+ * Fixed problem with WebMock and RSpec compatibility on TeamCity servers. See [this article](http://www.coding4streetcred.com/blog/post/Issue-RubyMine-31-Webmock-162-and-%E2%80%9CSpecconfigure%E2%80%9D-curse.aspx) for more details.
893
+
894
+ Thanks to [Christopher Pickslay](https://github.com/chrispix) from [Two Bit Labs](https://github.com/twobitlabs)
895
+
896
+
897
+ ## 1.7.8
898
+
899
+ * Fix each adapter so that it calls a `stub.with` block only once per
900
+ request. Previously, the block would be called two or three times per
901
+ request [Myron Marston](https://github.com/myronmarston).
902
+
903
+ ## 1.7.7 - RuPy 2011 release
904
+
905
+ * Passing response object to a block passed to `HTTPClient#do_get_block`. This fixes `HTTPClient.get_content` failures. [issue 130](https://github.com/bblimke/webmock/pull/130)
906
+
907
+ Thanks to [Chris McGrath](https://github.com/chrismcg)
908
+
909
+ * Cleaned up ruby warnings when running WebMock code with `-w`.
910
+
911
+ Thanks to [Stephen Celis](https://github.com/stephencelis)
912
+
913
+ * Curb adapter now correctly calls on_failure for 4xx response codes.
914
+
915
+ Thanks to [Eugene Pimenov](https://github.com/libc)
916
+
917
+ ## 1.7.6
918
+
919
+ * Support for the HTTPClient's request_filter feature
920
+
921
+ Thanks to [Roman Shterenzon](https://github.com/romanbsd)
922
+
923
+ ## 1.7.5
924
+
925
+ * Added support for Patron 0.4.15. This change is not backward compatible so please upgrade Patron to version >= 0.4.15 if you want to use it with WebMock.
926
+
927
+ Thanks to [Andreas Garnæs](https://github.com/andreas)
928
+
929
+ ## 1.7.4
930
+
931
+ * Added support for matching EM-HTTP-Request requests with body declared as a Hash
932
+
933
+ Thanks to [David Yeu](https://github.com/daveyeu)
934
+
935
+ ## 1.7.3
936
+
937
+ * Added `Get`, `Post`, `Delete`, `Put`, `Head`, `Option` constants to replaced `Net::HTTP` to make it possible to marshal objects with these constants assigned to properties. This fixed problem with `tvdb_party` gem which serializes HTTParty responses.
938
+
939
+ Thanks to [Klaus Hartl](https://github.com/carhartl) for reporting this issue.
940
+
941
+ ## 1.7.2
942
+
943
+ * Redefined `const_get` and `constants` methods on the replaced `Net::HTTP` to return same values as original `Net::HTTP`
944
+
945
+ ## 1.7.1
946
+
947
+ * Redefined `const_defined?` on the replaced `Net::HTTP` so that it returns true if constant is defined on the original `Net::HTTP`. This fixes problems with `"Net::HTTP::Get".constantize`.
948
+
949
+ Thanks to [Cássio Marques](https://github.com/cassiomarques) for reporting the issue and to [Myron Marston](https://github.com/myronmarston) for help with the solution.
950
+
951
+ ## 1.7.0
952
+
953
+ * Fixed Net::HTTP adapter to not break normal Net::HTTP behaviour when network connections are allowed. This fixes **selenium-webdriver compatibility**!!!
954
+
955
+ * Added support for EM-HTTP-Request 1.0.x and EM-Synchrony. Thanks to [Steve Hull](https://github.com/sdhull)
956
+
957
+ * Added support for setting expectations to on a stub itself i.e.
958
+
959
+ stub = stub_request(:get, "www.example.com")
960
+ # ... make requests ...
961
+ stub.should have_been_requested
962
+
963
+ Thanks to [Aidan Feldman](https://github.com/afeld)
964
+
965
+ * Minitest support! Thanks to [Peter Higgins](https://github.com/phiggins)
966
+
967
+ * Added support for Typhoeus::Hydra
968
+
969
+ * Added support for `Curb::Easy#http_post` and `Curb::Easy#http_post` with multiple arguments. Thanks to [Salvador Fuentes Jr](https://github.com/fuentesjr) and [Alex Rothenberg](https://github.com/alexrothenberg)
970
+
971
+ * Rack support. Requests can be stubbed to respond with a Rack app i.e.
972
+
973
+ class MyRackApp
974
+ def self.call(env)
975
+ [200, {}, ["Hello"]]
976
+ end
977
+ end
978
+
979
+ stub_request(:get, "www.example.com").to_rack(MyRackApp)
980
+
981
+ RestClient.get("www.example.com") # ===> "Hello"
982
+
983
+
984
+ Thanks to [Jay Adkisson](https://github.com/jayferd)
985
+
986
+ * Added support for selective disabling and enabling of http lib adapters
987
+
988
+ WebMock.disable! #disable WebMock (all adapters)
989
+ WebMock.disable!(:except => [:net_http]) #disable WebMock for all libs except Net::HTTP
990
+ WebMock.enable! #enable WebMock (all adapters)
991
+ WebMock.enable!(:except => [:patron]) #enable WebMock for all libs except Patron
992
+
993
+ * The error message on an unstubbed request shows a code snippet with body as a hash when it was in url encoded form.
994
+
995
+ > RestClient.post('www.example.com', "data[a]=1&data[b]=2", :content_type => 'application/x-www-form-urlencoded')
996
+
997
+ WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled....
998
+
999
+ You can stub this request with the following snippet:
1000
+
1001
+ stub_request(:post, "http://www.example.com/").
1002
+ with(:body => {"data"=>{"a"=>"1", "b"=>"2"}},
1003
+ :headers => { 'Content-Type'=>'application/x-www-form-urlencoded' }).
1004
+ to_return(:status => 200, :body => "", :headers => {})
1005
+
1006
+ Thanks to [Alex Rothenberg](https://github.com/alexrothenberg)
1007
+
1008
+ * The error message on an unstubbed request shows currently registered request stubs.
1009
+
1010
+ > stub_request(:get, "www.example.net")
1011
+ > stub_request(:get, "www.example.org")
1012
+ > RestClient.get("www.example.com")
1013
+ WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled....
1014
+
1015
+ You can stub this request with the following snippet:
1016
+
1017
+ stub_request(:get, "http://www.example.com/").
1018
+ to_return(:status => 200, :body => "", :headers => {})
1019
+
1020
+ registered request stubs:
1021
+
1022
+ stub_request(:get, "http://www.example.net/")
1023
+ stub_request(:get, "http://www.example.org/")
1024
+
1025
+ Thanks to [Lin Jen-Shin](https://github.com/godfat) for suggesting this feature.
1026
+
1027
+ * Fixed problem with matching requests with json body, when json strings have date format. Thanks to [Joakim Ekberg](https://github.com/kalasjocke) for reporting this issue.
1028
+
1029
+ * WebMock now attempts to require each http library before monkey patching it. This is to avoid problem when http library is required after WebMock is required. Thanks to [Myron Marston](https://github.com/myronmarston) for suggesting this change.
1030
+
1031
+ * External requests can be disabled while allowing selected ports on selected hosts
1032
+
1033
+ WebMock.disable_net_connect!(:allow => "www.example.com:8080")
1034
+ RestClient.get("www.example.com:80") # ===> Failure
1035
+ RestClient.get("www.example.com:8080") # ===> Allowed.
1036
+
1037
+ Thanks to [Zach Dennis](https://github.com/zdennis)
1038
+
1039
+ * Fixed syntax error in README examples, showing the ways of setting request expectations. Thanks to [Nikita Fedyashev](https://github.com/nfedyashev)
1040
+
1041
+
1042
+ **Many thanks to WebMock co-maintainer [James Conroy-Finn](https://github.com/jcf) who did a great job maintaining WebMock on his own for the last couple of months.**
1043
+
1044
+ ## 1.6.4
1045
+
1046
+ This is a quick slip release to regenerate the gemspec. Apparently
1047
+ jeweler inserts dependencies twice if you use the `gemspec` method in
1048
+ your Gemfile and declare gem dependencies in your gemspec.
1049
+
1050
+ https://github.com/technicalpickles/jeweler/issues/154
1051
+
1052
+ josevalim:
1053
+
1054
+ > This just bit me. I just released a gem with the wrong dependencies
1055
+ > because I have updated jeweler. This should have been opt-in,
1056
+ > otherwise a bunch of people using jeweler are going to release gems
1057
+ > with the wrong dependencies because you are automatically importing
1058
+ > from the Gemfile.
1059
+
1060
+ ## 1.6.3
1061
+
1062
+ * Update the dependency on addressable to get around an issue in v2.2.5.
1063
+ Thanks to [Peter Higgins](https://github.com/phiggins).
1064
+
1065
+ * Add support for matching parameter values using a regular expression
1066
+ as well as a string. Thanks to [Oleg M Prozorov](https://github.com/oleg).
1067
+
1068
+ * Fix integration with httpclient as the internal API has changed.
1069
+ Thanks to [Frank Prößdorf](https://github.com/endor).
1070
+
1071
+ * Ensure Curl::Easy#content_type is always set. Thanks to [Peter
1072
+ Higgins](https://github.com/phiggins).
1073
+
1074
+ * Fix bug with em-http-request adapter stubbing responses that have a
1075
+ chunked transfer encoding. Thanks to [Myron
1076
+ Marston](https://github.com/myronmarston).
1077
+
1078
+ * Fix a load of spec failures with Patron, httpclient, and specs that
1079
+ depended on the behaviour of example.com. Thanks to [Alex
1080
+ Grigorovich](https://github.com/grig).
1081
+
1082
+ ## 1.6.2
1083
+
1084
+ * Em-http-request adapter sets `last_effective_url` property. Thanks to [Sam Stokes](https://github.com/samstokes).
1085
+
1086
+ * Curb adapter supports `Curb::Easy#http_post` and `Curb::Easy#http_put` without arguments (by setting `post_body` or `put_data` beforehand). Thanks to [Eugene Bolshakov](https://github.com/eugenebolshakov)
1087
+
1088
+ ## 1.6.1
1089
+
1090
+ * Fixed issue with `webmock/rspec` which didn't load correctly if `rspec/core` was already required but `rspec/expectations` not.
1091
+
1092
+ ## 1.6.0
1093
+
1094
+ * Simplified integration with Test::Unit, RSpec and Cucumber. Now only a single file has to be required i.e.
1095
+
1096
+ require 'webmock/test_unit'
1097
+ require 'webmock/rspec'
1098
+ require 'webmock/cucumber'
1099
+
1100
+ * The error message on unstubbed request now contains code snippet which can be used to stub this request. Thanks to Martyn Loughran for suggesting this feature.
1101
+
1102
+ * The expectation failure message now contains a list of made requests. Thanks to Martyn Loughran for suggesting this feature.
1103
+
1104
+ * Added `WebMock.print_executed_requests` method which can be useful to find out what requests were made until a given point.
1105
+
1106
+ * em-http-request adapter is now activated by replacing EventMachine::HttpRequest constant, instead of monkeypatching the original class.
1107
+
1108
+ This technique is borrowed from em-http-request native mocking module. It allows switching WebMock adapter on an off, and using it interchangeably with em-http-request native mocking i.e:
1109
+
1110
+ EventMachine::WebMockHttpRequest.activate!
1111
+ EventMachine::WebMockHttpRequest.deactivate!
1112
+
1113
+ Thanks to Martyn Loughran for suggesting this feature.
1114
+
1115
+ * `WebMock.reset_webmock` is deprecated in favour of new `WebMock.reset!`
1116
+
1117
+ * Fixed integration with Cucumber. Previously documented example didn't work with new versions of Cucumber.
1118
+
1119
+ * Fixed stubbing requests with body declared as a hash. Thanks to Erik Michaels-Ober for reporting the issue.
1120
+
1121
+ * Fixed issue with em-http-request adapter which didn't work when :query option value was passed as a string, not a hash. Thanks to Chee Yeo for reporting the issue.
1122
+
1123
+ * Fixed problem with assert_requested which didn't work if used outside rspec or test/unit
1124
+
1125
+ * Removed dependency on json gem
1126
+
1127
+ ## 1.5.0
1128
+
1129
+ * Support for dynamically evaluated raw responses recorded with `curl -is` <br/>
1130
+ i.e.
1131
+
1132
+ `curl -is www.example.com > /tmp/www.example.com.txt`
1133
+ stub_request(:get, "www.example.com").to_return(lambda { |request| File.new("/tmp/#{request.uri.host.to_s}.txt" }))
1134
+
1135
+ * `:net_http_connect_on_start` option can be passed to `WebMock.allow_net_connect!` and `WebMock.disable_net_connect!` methods, i.e.
1136
+
1137
+ WebMock.allow_net_connect!(:net_http_connect_on_start => true)
1138
+
1139
+ This forces WebMock Net::HTTP adapter to always connect on `Net::HTTP.start`. Check 'Connecting on Net::HTTP.start' in README for more information.
1140
+
1141
+ Thanks to Alastair Brunton for reporting the issue and for fix suggestions.
1142
+
1143
+ * Fixed an issue where Patron spec tried to remove system temporary directory.
1144
+ Thanks to Hans de Graaff
1145
+
1146
+ * WebMock specs now use RSpec 2
1147
+
1148
+ * `rake spec NO_CONNECTION=true` can now be used to only run WebMock specs which do not make real network connections
1149
+
1150
+ ## 1.4.0
1151
+
1152
+ * Curb support!!! Thanks to the awesome work of Pete Higgins!
1153
+
1154
+ * `include WebMock` is now deprecated to avoid method and constant name conflicts. Please `include WebMock::API` instead.
1155
+
1156
+ * `WebMock::API#request` is renamed to `WebMock::API#a_request` to prevent method name conflicts with i.e. Rails controller specs.
1157
+ WebMock.request is still available.
1158
+
1159
+ * Deprecated `WebMock#request`, `WebMock#allow_net_connect!`, `WebMock#net_connect_allowed?`, `WebMock#registered_request?`, `WebMock#reset_callbacks`, `WebMock#after_request` instance methods. These methods are still available, but only as WebMock class methods.
1160
+
1161
+ * Removed `WebMock.response_for_request` and `WebMock.assertion_failure` which were only used internally and were not documented.
1162
+
1163
+ * :allow_localhost => true' now permits 0.0.0.0 in addition to 127.0.0.1 and 'localhost'. Thanks to Myron Marston and Mike Gehard for suggesting this.
1164
+
1165
+ * Fixed issue with both RSpec 1.x and 2.x being available.
1166
+
1167
+ WebMock now tries to use already loaded version of RSpec (1.x or 2.x). Previously it was loading RSpec 2.0 if available, even if RSpec 1.3 was already loaded.
1168
+
1169
+ Thanks to Hans de Graaff for reporting this.
1170
+
1171
+ * Changed runtime dependency on Addressable version 2.2.2 which fixes handling of percent-escaped '+'
1172
+
1173
+ ## 1.3.5
1174
+
1175
+ * External requests can be disabled while allowing selected hosts. Thanks to Charles Li and Ryan Bigg
1176
+
1177
+ This feature was available before only for localhost with `:allow_localhost => true`
1178
+
1179
+ WebMock.disable_net_connect!(:allow => "www.example.org")
1180
+
1181
+ Net::HTTP.get('www.something.com', '/') # ===> Failure
1182
+
1183
+ Net::HTTP.get('www.example.org', '/') # ===> Allowed.
1184
+
1185
+ * Fixed Net::HTTP adapter so that it preserves the original behavior of Net::HTTP.
1186
+
1187
+ When making a request with a block that calls #read_body on the request,
1188
+ Net::HTTP causes the body to be set to a Net::ReadAdapter, but WebMock was causing the body to be set to a string.
1189
+
1190
+ ## 1.3.4
1191
+
1192
+ * Fixed Net::HTTP adapter to handle cases where a block with `read_body` call is passed to `request`.
1193
+ This fixes compatibility with `open-uri`. Thanks to Mark Evans for reporting the issue.
1194
+
1195
+ ## 1.3.3
1196
+
1197
+ * Fixed handling of multiple values for the same response header for Net::HTTP. Thanks to Myron Marston for reporting the issue.
1198
+
1199
+ ## 1.3.2
1200
+
1201
+ * Fixed compatibility with EM-HTTP-Request >= 0.2.9. Thanks to Myron Marston for reporting the issue.
1202
+
1203
+ ## 1.3.1
1204
+
1205
+ * The less hacky way to get the stream behaviour working for em-http-request. Thanks to Martyn Loughran
1206
+
1207
+ * Fixed issues where Net::HTTP was not accepting valid nil response body. Thanks to Muness Alrubaie
1208
+
1209
+ ## 1.3.0
1210
+
1211
+ * Added support for [em-http-request](http://github.com/igrigorik/em-http-request)
1212
+
1213
+ * Matching query params using a hash
1214
+
1215
+ stub_http_request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})
1216
+
1217
+ RestClient.get("http://www.example.com/?a[]=b&a[]=c") # ===> Success
1218
+
1219
+ request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]}).should have_been_made # ===> Success
1220
+
1221
+ * Matching request body against a hash. Body can be URL-Encoded, JSON or XML.
1222
+
1223
+ (Thanks to Steve Tooke for the idea and a solution for url-encoded bodies)
1224
+
1225
+ stub_http_request(:post, "www.example.com").
1226
+ with(:body => {:data => {:a => '1', :b => 'five'}})
1227
+
1228
+ RestClient.post('www.example.com', "data[a]=1&data[b]=five",
1229
+ :content_type => 'application/x-www-form-urlencoded') # ===> Success
1230
+
1231
+ RestClient.post('www.example.com', '{"data":{"a":"1","b":"five"}}',
1232
+ :content_type => 'application/json') # ===> Success
1233
+
1234
+ RestClient.post('www.example.com', '<data a="1" b="five" />',
1235
+ :content_type => 'application/xml' ) # ===> Success
1236
+
1237
+ request(:post, "www.example.com").
1238
+ with(:body => {:data => {:a => '1', :b => 'five'}},
1239
+ :headers => 'Content-Type' => 'application/json').should have_been_made # ===> Success
1240
+
1241
+ * Request callbacks (Thanks to Myron Marston for all suggestions)
1242
+
1243
+ WebMock can now invoke callbacks for stubbed or real requests:
1244
+
1245
+ WebMock.after_request do |request_signature, response|
1246
+ puts "Request #{request_signature} was made and #{response} was returned"
1247
+ end
1248
+
1249
+ invoke callbacks for real requests only and except requests made with Patron client
1250
+
1251
+ WebMock.after_request(:except => [:patron], :real_requests_only => true) do |request_signature, response|
1252
+ puts "Request #{request_signature} was made and #{response} was returned"
1253
+ end
1254
+
1255
+ * `to_raise()` now accepts an exception instance or a string as argument in addition to an exception class
1256
+
1257
+ stub_request(:any, 'www.example.net').to_raise(StandardError.new("some error"))
1258
+
1259
+ stub_request(:any, 'www.example.net').to_raise("some error")
1260
+
1261
+ * Matching requests based on a URI is 30% faster
1262
+
1263
+ * Fixed constant namespace issues in HTTPClient adapter. Thanks to Nathaniel Bibler for submitting a patch.
1264
+
1265
+ ## 1.2.2
1266
+
1267
+ * Fixed problem where ArgumentError was raised if query params were made up of an array e.g. data[]=a&data[]=b. Thanks to Steve Tooke
1268
+
1269
+ ## 1.2.1
1270
+
1271
+ * Changed license from GPL to MIT
1272
+
1273
+ * Fixed gemspec file. Thanks to Razic
1274
+
1275
+ ## 1.2.0
1276
+
1277
+ * RSpec 2 compatibility. Thanks to Sam Phillips!
1278
+
1279
+ * :allow_localhost => true' now permits 127.0.0.1 as well as 'localhost'. Thanks to Mack Earnhardt
1280
+
1281
+ * Request URI matching in now 2x faster!
1282
+
1283
+
1284
+ ## 1.1.0
1285
+
1286
+ * [VCR](http://github.com/myronmarston/vcr/) compatibility. Many thanks to Myron Marston for all suggestions.
1287
+
1288
+ * Support for stubbing requests and returning responses with multiple headers with the same name. i.e multiple Accept headers.
1289
+
1290
+ stub_http_request(:get, 'www.example.com').
1291
+ with(:headers => {'Accept' => ['image/png', 'image/jpeg']}).
1292
+ to_return(:body => 'abc')
1293
+ RestClient.get('www.example.com',
1294
+ {"Accept" => ['image/png', 'image/jpeg']}) # ===> "abc\n"
1295
+
1296
+ * When real net connections are disabled and unstubbed request is made, WebMock throws WebMock::NetConnectNotAllowedError instead of assertion error or StandardError.
1297
+
1298
+ * Added WebMock.version()
1299
+
1300
+
1301
+ ## 1.0.0
1302
+
1303
+ * Added support for [Patron](http://toland.github.com/patron/)
1304
+
1305
+ * Responses dynamically evaluated from block (idea and implementation by Tom Ward)
1306
+
1307
+ stub_request(:any, 'www.example.net').
1308
+ to_return { |request| {:body => request.body} }
1309
+
1310
+ RestClient.post('www.example.net', 'abc') # ===> "abc\n"
1311
+
1312
+ * Responses dynamically evaluated from lambda (idea and implementation by Tom Ward)
1313
+
1314
+ stub_request(:any, 'www.example.net').
1315
+ to_return(lambda { |request| {:body => request.body} })
1316
+
1317
+ RestClient.post('www.example.net', 'abc') # ===> "abc\n"
1318
+
1319
+ * Response with custom status message
1320
+
1321
+ stub_request(:any, "www.example.com").to_return(:status => [500, "Internal Server Error"])
1322
+
1323
+ req = Net::HTTP::Get.new("/")
1324
+ Net::HTTP.start("www.example.com") { |http| http.request(req) }.message # ===> "Internal Server Error"
1325
+
1326
+ * Raising timeout errors (suggested by Jeffrey Jones) (compatibility with Ruby 1.8.6 by Mack Earnhardt)
1327
+
1328
+ stub_request(:any, 'www.example.net').to_timeout
1329
+
1330
+ RestClient.post('www.example.net', 'abc') # ===> RestClient::RequestTimeout
1331
+
1332
+ * External requests can be disabled while allowing localhost (idea and implementation by Mack Earnhardt)
1333
+
1334
+ WebMock.disable_net_connect!(:allow_localhost => true)
1335
+
1336
+ Net::HTTP.get('www.something.com', '/') # ===> Failure
1337
+
1338
+ Net::HTTP.get('localhost:9887', '/') # ===> Allowed. Perhaps to Selenium?
1339
+
1340
+
1341
+ ### Bug fixes
1342
+
1343
+ * Fixed issue where Net::HTTP adapter didn't work for requests with body responding to read (reported by Tekin Suleyman)
1344
+ * Fixed issue where request stub with headers declared as nil was matching requests with non empty headers
1345
+
1346
+ ## 0.9.1
1347
+
1348
+ * Fixed issue where response status code was not read from raw (curl -is) responses
1349
+
1350
+ ## 0.9.0
1351
+
1352
+ * Matching requests against provided block (by Sergio Gil)
1353
+
1354
+ stub_request(:post, "www.example.com").with { |request| request.body == "abc" }.to_return(:body => "def")
1355
+ RestClient.post('www.example.com', 'abc') # ===> "def\n"
1356
+ request(:post, "www.example.com").with { |req| req.body == "abc" }.should have_been_made
1357
+ #or
1358
+ assert_requested(:post, "www.example.com") { |req| req.body == "abc" }
1359
+
1360
+ * Matching request body against regular expressions (suggested by Ben Pickles)
1361
+
1362
+ stub_request(:post, "www.example.com").with(:body => /^.*world$/).to_return(:body => "abc")
1363
+ RestClient.post('www.example.com', 'hello world') # ===> "abc\n"
1364
+
1365
+ * Matching request headers against regular expressions (suggested by Ben Pickles)
1366
+
1367
+ stub_request(:post, "www.example.com").with(:headers => {"Content-Type" => /image\/.+/}).to_return(:body => "abc")
1368
+ RestClient.post('www.example.com', '', {'Content-Type' => 'image/png'}) # ===> "abc\n"
1369
+
1370
+ * Replaying raw responses recorded with `curl -is`
1371
+
1372
+ `curl -is www.example.com > /tmp/example_curl_-is_output.txt`
1373
+ raw_response_file = File.new("/tmp/example_curl_-is_output.txt")
1374
+
1375
+ from file
1376
+
1377
+ stub_request(:get, "www.example.com").to_return(raw_response_file)
1378
+
1379
+ or string
1380
+
1381
+ stub_request(:get, "www.example.com").to_return(raw_response_file.read)
1382
+
1383
+ * Multiple responses for repeated requests
1384
+
1385
+ stub_request(:get, "www.example.com").to_return({:body => "abc"}, {:body => "def"})
1386
+ Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
1387
+ Net::HTTP.get('www.example.com', '/') # ===> "def\n"
1388
+
1389
+ * Multiple responses using chained `to_return()` or `to_raise()` declarations
1390
+
1391
+ stub_request(:get, "www.example.com").
1392
+ to_return({:body => "abc"}).then. #then() just is a syntactic sugar
1393
+ to_return({:body => "def"}).then.
1394
+ to_raise(MyException)
1395
+ Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
1396
+ Net::HTTP.get('www.example.com', '/') # ===> "def\n"
1397
+ Net::HTTP.get('www.example.com', '/') # ===> MyException raised
1398
+
1399
+ * Specifying number of times given response should be returned
1400
+
1401
+ stub_request(:get, "www.example.com").
1402
+ to_return({:body => "abc"}).times(2).then.
1403
+ to_return({:body => "def"})
1404
+
1405
+ Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
1406
+ Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
1407
+ Net::HTTP.get('www.example.com', '/') # ===> "def\n"
1408
+
1409
+ * Added support for `Net::HTTP::Post#body_stream`
1410
+
1411
+ This fixes compatibility with new versions of RestClient
1412
+
1413
+ * WebMock doesn't suppress default request headers added by http clients anymore.
1414
+
1415
+ i.e. Net::HTTP adds `'Accept'=>'*/*'` to all requests by default
1416
+
1417
+
1418
+
1419
+ ## 0.8.2
1420
+
1421
+ * Fixed issue where WebMock was not closing IO object passed as response body after reading it.
1422
+ * Ruby 1.9.2 compat: Use `File#expand_path` for require path because "." is not be included in LOAD_PATH since Ruby 1.9.2
1423
+
1424
+
1425
+ ## 0.8.1
1426
+
1427
+ * Fixed HTTPClient adapter compatibility with Ruby 1.8.6 (reported by Piotr Usewicz)
1428
+ * Net:HTTP adapter now handles request body assigned as Net::HTTP::Post#body attribute (fixed by Mack Earnhardt)
1429
+ * Fixed issue where requests were not matching stubs with Accept header set.(reported by Piotr Usewicz)
1430
+ * Fixed compatibility with Ruby 1.9.1, 1.9.2 and JRuby 1.3.1 (reported by Diego E. “Flameeyes” Pettenò)
1431
+ * Fixed issue with response body declared as IO object and multiple requests (reported by Niels Meersschaert)
1432
+ * Fixed "undefined method `assertion_failure'" error (reported by Nick Plante)
1433
+
1434
+
1435
+ ## 0.8.0
1436
+
1437
+ * Support for HTTPClient (sync and async requests)
1438
+ * Support for dynamic responses. Response body and headers can be now declared as lambda.
1439
+ (Thanks to Ivan Vega ( @ivanyv ) for suggesting this feature)
1440
+ * Support for stubbing and expecting requests with empty body
1441
+ * Executing non-stubbed request leads to failed expectation instead of error
1442
+
1443
+
1444
+ ### Bug fixes
1445
+
1446
+ * Basic authentication now works correctly
1447
+ * Fixed problem where WebMock didn't call a block with the response when block was provided
1448
+ * Fixed problem where uris with single slash were not matching uris without path provided
1449
+
1450
+
1451
+ ## 0.7.3
1452
+
1453
+ * Clarified documentation
1454
+ * Fixed some issues with loading of Webmock classes
1455
+ * Test::Unit and RSpec adapters have to be required separately
1456
+
1457
+
1458
+ ## 0.7.2
1459
+
1460
+ * Added support for matching escaped and non escaped URLs