simple-client 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.bundle/config +4 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +23 -0
- data/bin/rake +16 -0
- data/lib/simple-client/simple-client.rb +229 -0
- data/lib/simple-client/version.rb +4 -0
- data/lib/simple-client.rb +1 -0
- data/test/test_simple-client.rb +236 -0
- data/vendor/bundle/ruby/1.8/bin/rake +19 -0
- data/vendor/bundle/ruby/1.8/cache/addressable-2.2.8.gem +0 -0
- data/vendor/bundle/ruby/1.8/cache/crack-0.3.1.gem +0 -0
- data/vendor/bundle/ruby/1.8/cache/rake-0.9.2.2.gem +0 -0
- data/vendor/bundle/ruby/1.8/cache/webmock-1.8.8.gem +0 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/CHANGELOG.md +126 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/Gemfile +17 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/Gemfile.lock +35 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/README.md +83 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/Rakefile +37 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/idna/native.rb +43 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/idna/pure.rb +4886 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/idna.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/template.rb +1047 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/uri.rb +2288 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/lib/addressable/version.rb +30 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/spec/addressable/idna_spec.rb +216 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/spec/addressable/net_http_compat_spec.rb +26 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/spec/addressable/template_spec.rb +2144 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/spec/addressable/uri_spec.rb +4928 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/clobber.rake +2 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/gem.rake +85 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/git.rake +45 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/metrics.rake +22 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/rspec.rake +58 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/rubyforge.rake +89 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/tasks/yard.rake +27 -0
- data/vendor/bundle/ruby/1.8/gems/addressable-2.2.8/website/index.html +110 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/History +25 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/LICENSE +20 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/README.rdoc +42 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/Rakefile +32 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/crack.gemspec +53 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/lib/crack/json.rb +79 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/lib/crack/util.rb +17 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/lib/crack/xml.rb +232 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/lib/crack.rb +8 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/crack_test.rb +4 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/data/twittersearch-firefox.json +1 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/data/twittersearch-ie.json +1 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/hash_test.rb +28 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/json_test.rb +82 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/parser_test.rb +27 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/string_test.rb +31 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/test_helper.rb +12 -0
- data/vendor/bundle/ruby/1.8/gems/crack-0.3.1/test/xml_test.rb +499 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/CHANGES +522 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/README.rdoc +197 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/Rakefile +369 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/TODO +20 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/bin/rake +33 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/command_line_usage.rdoc +114 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/glossary.rdoc +51 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/rake.1.gz +0 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/rakefile.rdoc +557 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.6.rdoc +55 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/install.rb +90 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/alt_system.rb +109 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb +595 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/classic_namespace.rb +11 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/clean.rb +32 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/cloneable.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/compositepublisher.rb +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/ftptools.rb +150 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/publisher.rb +73 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/rubyforgepublisher.rb +16 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/sshpublisher.rb +50 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/contrib/sys.rb +191 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/default_loader.rb +10 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb +176 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/early_time.rb +18 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ext/core.rb +27 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ext/module.rb +39 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ext/string.rb +167 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ext/time.rb +14 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_list.rb +403 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_task.rb +47 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_utils.rb +114 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb +145 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/gempackagetask.rb +15 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/invocation_chain.rb +51 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/loaders/makefile.rb +40 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/multi_task.rb +16 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/name_space.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/packagetask.rb +185 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/pathmap.rb +1 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/pseudo_status.rb +24 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/rake_module.rb +29 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb +22 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb +234 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/ruby182_test_unit_fix.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/runtest.rb +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb +327 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task_arguments.rb +78 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task_manager.rb +307 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/tasklib.rb +22 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/testtask.rb +191 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/version.rb +8 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/win32.rb +55 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake.rb +69 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/file_creation.rb +34 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/helper.rb +492 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake.rb +40 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_application.rb +489 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_application_options.rb +335 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_clean.rb +14 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_definitions.rb +80 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_directory_task.rb +46 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_dsl.rb +77 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_early_time.rb +31 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_extension.rb +59 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_creation_task.rb +56 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_list.rb +628 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_list_path_map.rb +8 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_task.rb +102 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_file_utils.rb +305 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_ftp_file.rb +59 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_functional.rb +450 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_invocation_chain.rb +52 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_makefile_loader.rb +44 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_multi_task.rb +51 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_name_space.rb +43 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_package_task.rb +79 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_path_map.rb +157 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_path_map_explode.rb +34 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_path_map_partial.rb +18 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_pseudo_status.rb +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_rake_test_loader.rb +21 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_rdoc_task.rb +83 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_require.rb +40 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_rules.rb +327 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task.rb +267 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_argument_parsing.rb +103 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_arguments.rb +88 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_lib.rb +9 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_manager.rb +157 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_manager_argument_resolution.rb +36 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_task_with_arguments.rb +173 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_test_task.rb +120 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_top_level_functions.rb +111 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_rake_win32.rb +72 -0
- data/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/test/test_sys.rb +20 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/CHANGELOG.md +749 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/Gemfile +21 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/Guardfile +24 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/LICENSE +20 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/README.md +728 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/Rakefile +65 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/api.rb +63 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/assertion_failure.rb +11 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/callback_registry.rb +35 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/config.rb +10 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/cucumber.rb +8 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/deprecation.rb +9 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/errors.rb +33 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/curb_adapter.rb +287 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/em_http_request/em_http_request_0_x.rb +151 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/em_http_request/em_http_request_1_x.rb +212 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +11 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/excon_adapter.rb +95 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/http_lib_adapter.rb +7 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +19 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/httpclient_adapter.rb +193 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/net_http.rb +279 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/net_http_response.rb +34 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/patron_adapter.rb +129 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +180 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/matchers/hash_including_matcher.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/minitest.rb +15 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rack_response.rb +63 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_execution_verifier.rb +56 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_pattern.rb +282 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_registry.rb +35 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_signature.rb +50 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/request_stub.rb +97 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/response.rb +144 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/responses_sequence.rb +40 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rspec/matchers/request_pattern_matcher.rb +42 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rspec/matchers/webmock_matcher.rb +46 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rspec/matchers.rb +28 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/rspec.rb +33 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/stub_registry.rb +61 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/stub_request_snippet.rb +30 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/test_unit.rb +20 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/hash_counter.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/hash_keys_stringifier.rb +23 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/headers.rb +43 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/json.rb +54 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/uri.rb +101 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/util/version_checker.rb +73 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/version.rb +3 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock/webmock.rb +124 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/lib/webmock.rb +49 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/minitest/test_helper.rb +29 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/minitest/test_webmock.rb +6 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/minitest/webmock_spec.rb +50 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/curb/curb_spec.rb +340 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/curb/curb_spec_helper.rb +144 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/em_http_request/em_http_request_spec.rb +183 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +72 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/excon/excon_spec.rb +15 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/excon/excon_spec_helper.rb +38 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/httpclient/httpclient_spec.rb +76 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/httpclient/httpclient_spec_helper.rb +48 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/net_http/net_http_shared.rb +125 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/net_http/net_http_spec.rb +255 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/net_http/net_http_spec_helper.rb +55 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/net_http/real_net_http_spec.rb +20 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/patron/patron_spec.rb +136 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/patron/patron_spec_helper.rb +50 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +142 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/callbacks.rb +146 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/complex_cross_concern_behaviors.rb +36 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/enabling_and_disabling_webmock.rb +95 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/precedence_of_stubs.rb +15 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/request_expectations.rb +666 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/returning_declared_responses.rb +367 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/shared/stubbing_requests.rb +447 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +74 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +56 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/acceptance/webmock_shared.rb +41 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/quality_spec.rb +60 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/spec_helper.rb +57 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/support/example_curl_output.txt +22 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/support/my_rack_app.rb +48 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/support/network_connection.rb +25 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/support/webmock_server.rb +65 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/errors_spec.rb +32 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +17 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +12 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/rack_response_spec.rb +74 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_execution_verifier_spec.rb +100 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_pattern_spec.rb +479 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_registry_spec.rb +75 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_signature_spec.rb +113 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/request_stub_spec.rb +198 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/response_spec.rb +267 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/stub_registry_spec.rb +86 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/stub_request_snippet_spec.rb +95 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/hash_counter_spec.rb +39 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/hash_keys_stringifier_spec.rb +27 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/headers_spec.rb +28 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/json_spec.rb +7 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/uri_spec.rb +257 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/util/version_checker_spec.rb +59 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/spec/unit/webmock_spec.rb +7 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/test/http_request.rb +24 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/test/shared_test.rb +76 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/test/test_helper.rb +23 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/test/test_webmock.rb +6 -0
- data/vendor/bundle/ruby/1.8/gems/webmock-1.8.8/webmock.gemspec +35 -0
- data/vendor/bundle/ruby/1.8/specifications/addressable-2.2.8.gemspec +38 -0
- data/vendor/bundle/ruby/1.8/specifications/crack-0.3.1.gemspec +25 -0
- data/vendor/bundle/ruby/1.8/specifications/rake-0.9.2.2.gemspec +33 -0
- data/vendor/bundle/ruby/1.8/specifications/webmock-1.8.8.gemspec +61 -0
- metadata +390 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe WebMock::StubRequestSnippet do
|
4
|
+
describe "to_s" do
|
5
|
+
describe "GET" do
|
6
|
+
before(:each) do
|
7
|
+
@request_signature = WebMock::RequestSignature.new(:get, "www.example.com/?a=b&c=d", :headers => {})
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should print stub request snippet with url with params and method and empty successful response" do
|
11
|
+
expected = %Q(stub_request(:get, "http://www.example.com/?a=b&c=d").\n to_return(:status => 200, :body => "", :headers => {}))
|
12
|
+
@request_stub = WebMock::RequestStub.from_request_signature(@request_signature)
|
13
|
+
WebMock::StubRequestSnippet.new(@request_stub).to_s.should == expected
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should print stub request snippet with body if available" do
|
17
|
+
@request_signature.body = "abcdef"
|
18
|
+
expected = %Q(stub_request(:get, "http://www.example.com/?a=b&c=d").)+
|
19
|
+
"\n with(:body => \"abcdef\")." +
|
20
|
+
"\n to_return(:status => 200, :body => \"\", :headers => {})"
|
21
|
+
@request_stub = WebMock::RequestStub.from_request_signature(@request_signature)
|
22
|
+
WebMock::StubRequestSnippet.new(@request_stub).to_s.should == expected
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should print stub request snippet with multiline body" do
|
26
|
+
@request_signature.body = "abc\ndef"
|
27
|
+
expected = %Q(stub_request(:get, "http://www.example.com/?a=b&c=d").)+
|
28
|
+
"\n with(:body => \"abc\\ndef\")." +
|
29
|
+
"\n to_return(:status => 200, :body => \"\", :headers => {})"
|
30
|
+
@request_stub = WebMock::RequestStub.from_request_signature(@request_signature)
|
31
|
+
WebMock::StubRequestSnippet.new(@request_stub).to_s.should == expected
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should print stub request snippet with headers if any" do
|
35
|
+
@request_signature.headers = {'B' => 'b', 'A' => 'a'}
|
36
|
+
expected = 'stub_request(:get, "http://www.example.com/?a=b&c=d").'+
|
37
|
+
"\n with(:headers => {\'A\'=>\'a\', \'B\'=>\'b\'})." +
|
38
|
+
"\n to_return(:status => 200, :body => \"\", :headers => {})"
|
39
|
+
@request_stub = WebMock::RequestStub.from_request_signature(@request_signature)
|
40
|
+
WebMock::StubRequestSnippet.new(@request_stub).to_s.should == expected
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should print stub request snippet with body and headers" do
|
44
|
+
@request_signature.body = "abcdef"
|
45
|
+
@request_signature.headers = {'B' => 'b', 'A' => 'a'}
|
46
|
+
expected = 'stub_request(:get, "http://www.example.com/?a=b&c=d").'+
|
47
|
+
"\n with(:body => \"abcdef\",\n :headers => {\'A\'=>\'a\', \'B\'=>\'b\'})." +
|
48
|
+
"\n to_return(:status => 200, :body => \"\", :headers => {})"
|
49
|
+
@request_stub = WebMock::RequestStub.from_request_signature(@request_signature)
|
50
|
+
WebMock::StubRequestSnippet.new(@request_stub).to_s.should == expected
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should not print to_return part if not wanted" do
|
54
|
+
expected = 'stub_request(:get, "http://www.example.com/").'+
|
55
|
+
"\n with(:body => \"abcdef\")"
|
56
|
+
stub = WebMock::RequestStub.new(:get, "www.example.com").with(:body => "abcdef").to_return(:body => "hello")
|
57
|
+
WebMock::StubRequestSnippet.new(stub).to_s(false).should == expected
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe "POST" do
|
62
|
+
let(:form_body) { 'user%5bfirst_name%5d=Bartosz' }
|
63
|
+
let(:multipart_form_body) { 'complicated stuff--ABC123--goes here' }
|
64
|
+
it "should print stub request snippet with body as a hash using rails conventions on form posts" do
|
65
|
+
@request_signature = WebMock::RequestSignature.new(:post, "www.example.com",
|
66
|
+
:headers => {'Content-Type' => 'application/x-www-form-urlencoded'},
|
67
|
+
:body => form_body)
|
68
|
+
@request_stub = WebMock::RequestStub.from_request_signature(@request_signature)
|
69
|
+
expected = <<-STUB
|
70
|
+
stub_request(:post, "http://www.example.com/").
|
71
|
+
with(:body => {"user"=>{"first_name"=>"Bartosz"}},
|
72
|
+
:headers => {'Content-Type'=>'application/x-www-form-urlencoded'}).
|
73
|
+
to_return(:status => 200, :body => \"\", :headers => {})
|
74
|
+
STUB
|
75
|
+
WebMock::StubRequestSnippet.new(@request_stub).to_s.should == expected.strip
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should print stub request snippet leaving body as string when not a urlencoded form" do
|
79
|
+
@request_signature = WebMock::RequestSignature.new(:post, "www.example.com",
|
80
|
+
:headers => {'Content-Type' => 'multipart/form-data; boundary=ABC123'},
|
81
|
+
:body => multipart_form_body)
|
82
|
+
@request_stub = WebMock::RequestStub.from_request_signature(@request_signature)
|
83
|
+
expected = <<-STUB
|
84
|
+
stub_request(:post, "http://www.example.com/").
|
85
|
+
with(:body => "#{multipart_form_body}",
|
86
|
+
:headers => {'Content-Type'=>'multipart/form-data; boundary=ABC123'}).
|
87
|
+
to_return(:status => 200, :body => \"\", :headers => {})
|
88
|
+
STUB
|
89
|
+
WebMock::StubRequestSnippet.new(@request_stub).to_s.should == expected.strip
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe WebMock::Util::HashCounter do
|
4
|
+
|
5
|
+
it "should return 0 for non existing key" do
|
6
|
+
WebMock::Util::HashCounter.new.get(:abc).should == 0
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should increase the returned value on every put with the same key" do
|
10
|
+
counter = WebMock::Util::HashCounter.new
|
11
|
+
counter.put(:abc)
|
12
|
+
counter.get(:abc).should == 1
|
13
|
+
counter.put(:abc)
|
14
|
+
counter.get(:abc).should == 2
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should only increase value for given key provided to put" do
|
18
|
+
counter = WebMock::Util::HashCounter.new
|
19
|
+
counter.put(:abc)
|
20
|
+
counter.get(:abc).should == 1
|
21
|
+
counter.get(:def).should == 0
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "each" do
|
25
|
+
it "should provide elements in order of the last modified" do
|
26
|
+
counter = WebMock::Util::HashCounter.new
|
27
|
+
counter.put(:a)
|
28
|
+
counter.put(:b)
|
29
|
+
counter.put(:c)
|
30
|
+
counter.put(:b)
|
31
|
+
counter.put(:a)
|
32
|
+
counter.put(:d)
|
33
|
+
|
34
|
+
elements = []
|
35
|
+
counter.each {|k,v| elements << [k,v]}
|
36
|
+
elements.should == [[:c, 1], [:b, 2], [:a, 2], [:d, 1]]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe WebMock::Util::HashKeysStringifier do
|
4
|
+
|
5
|
+
it "should recursively stringify all symbol keys" do
|
6
|
+
hash = {
|
7
|
+
:a => {
|
8
|
+
:b => [
|
9
|
+
{
|
10
|
+
:c => [{:d => "1"}]
|
11
|
+
}
|
12
|
+
]
|
13
|
+
}
|
14
|
+
}
|
15
|
+
stringified = {
|
16
|
+
'a' => {
|
17
|
+
'b' => [
|
18
|
+
{
|
19
|
+
'c' => [{'d' => "1"}]
|
20
|
+
}
|
21
|
+
]
|
22
|
+
}
|
23
|
+
}
|
24
|
+
WebMock::Util::HashKeysStringifier.stringify_keys!(hash).should == stringified
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe WebMock::Util::Headers do
|
4
|
+
|
5
|
+
it "should decode_userinfo_from_header handles basic auth" do
|
6
|
+
authorization_header = "Basic dXNlcm5hbWU6c2VjcmV0"
|
7
|
+
userinfo = WebMock::Util::Headers.decode_userinfo_from_header(authorization_header)
|
8
|
+
userinfo.should == "username:secret"
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "sorted_headers_string" do
|
12
|
+
|
13
|
+
it "should return nice string for hash with string values" do
|
14
|
+
WebMock::Util::Headers.sorted_headers_string({"a" => "b"}).should == "{'A'=>'b'}"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should return nice string for hash with array values" do
|
18
|
+
WebMock::Util::Headers.sorted_headers_string({"a" => ["b", "c"]}).should == "{'A'=>['b', 'c']}"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should return nice string for hash with array values and string values" do
|
22
|
+
WebMock::Util::Headers.sorted_headers_string({"a" => ["b", "c"], "d" => "e"}).should == "{'A'=>['b', 'c'], 'D'=>'e'}"
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,257 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
URIS_WITHOUT_PATH_OR_PARAMS =
|
5
|
+
[
|
6
|
+
"www.example.com",
|
7
|
+
"www.example.com/",
|
8
|
+
"www.example.com:80",
|
9
|
+
"www.example.com:80/",
|
10
|
+
"http://www.example.com",
|
11
|
+
"http://www.example.com/",
|
12
|
+
"http://www.example.com:80",
|
13
|
+
"http://www.example.com:80/"
|
14
|
+
].sort
|
15
|
+
|
16
|
+
URIS_WITHOUT_PATH_BUT_WITH_PARAMS =
|
17
|
+
[
|
18
|
+
"www.example.com?a=b",
|
19
|
+
"www.example.com/?a=b",
|
20
|
+
"www.example.com:80?a=b",
|
21
|
+
"www.example.com:80/?a=b",
|
22
|
+
"http://www.example.com?a=b",
|
23
|
+
"http://www.example.com/?a=b",
|
24
|
+
"http://www.example.com:80?a=b",
|
25
|
+
"http://www.example.com:80/?a=b"
|
26
|
+
].sort
|
27
|
+
|
28
|
+
URIS_WITH_AUTH =
|
29
|
+
[
|
30
|
+
"a b:pass@www.example.com",
|
31
|
+
"a b:pass@www.example.com/",
|
32
|
+
"a b:pass@www.example.com:80",
|
33
|
+
"a b:pass@www.example.com:80/",
|
34
|
+
"http://a b:pass@www.example.com",
|
35
|
+
"http://a b:pass@www.example.com/",
|
36
|
+
"http://a b:pass@www.example.com:80",
|
37
|
+
"http://a b:pass@www.example.com:80/",
|
38
|
+
"a%20b:pass@www.example.com",
|
39
|
+
"a%20b:pass@www.example.com/",
|
40
|
+
"a%20b:pass@www.example.com:80",
|
41
|
+
"a%20b:pass@www.example.com:80/",
|
42
|
+
"http://a%20b:pass@www.example.com",
|
43
|
+
"http://a%20b:pass@www.example.com/",
|
44
|
+
"http://a%20b:pass@www.example.com:80",
|
45
|
+
"http://a%20b:pass@www.example.com:80/"
|
46
|
+
].sort
|
47
|
+
|
48
|
+
URIS_WITH_PATH_AND_PARAMS =
|
49
|
+
[
|
50
|
+
"www.example.com/my path/?a=my param&b=c",
|
51
|
+
"www.example.com/my%20path/?a=my%20param&b=c",
|
52
|
+
"www.example.com:80/my path/?a=my param&b=c",
|
53
|
+
"www.example.com:80/my%20path/?a=my%20param&b=c",
|
54
|
+
"http://www.example.com/my path/?a=my param&b=c",
|
55
|
+
"http://www.example.com/my%20path/?a=my%20param&b=c",
|
56
|
+
"http://www.example.com:80/my path/?a=my param&b=c",
|
57
|
+
"http://www.example.com:80/my%20path/?a=my%20param&b=c",
|
58
|
+
].sort
|
59
|
+
|
60
|
+
URIS_WITH_DIFFERENT_PORT =
|
61
|
+
[
|
62
|
+
"www.example.com:88",
|
63
|
+
"www.example.com:88/",
|
64
|
+
"http://www.example.com:88",
|
65
|
+
"http://www.example.com:88/"
|
66
|
+
].sort
|
67
|
+
|
68
|
+
|
69
|
+
URIS_FOR_HTTPS =
|
70
|
+
[
|
71
|
+
"https://www.example.com",
|
72
|
+
"https://www.example.com/",
|
73
|
+
"https://www.example.com:443",
|
74
|
+
"https://www.example.com:443/"
|
75
|
+
].sort
|
76
|
+
|
77
|
+
|
78
|
+
describe WebMock::Util::URI do
|
79
|
+
|
80
|
+
describe "reporting variations of uri" do
|
81
|
+
|
82
|
+
it "should find all variations of the same uri for all variations of uri with params and path" do
|
83
|
+
URIS_WITH_PATH_AND_PARAMS.each do |uri|
|
84
|
+
WebMock::Util::URI.variations_of_uri_as_strings(uri).sort.should == URIS_WITH_PATH_AND_PARAMS
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should find all variations of the same uri for all variations of uri with params but without path" do
|
89
|
+
URIS_WITHOUT_PATH_BUT_WITH_PARAMS.each do |uri|
|
90
|
+
WebMock::Util::URI.variations_of_uri_as_strings(uri).sort.should == URIS_WITHOUT_PATH_BUT_WITH_PARAMS
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should find all variations of the same uri for all variations of uri without params or path" do
|
95
|
+
URIS_WITHOUT_PATH_OR_PARAMS.each do |uri|
|
96
|
+
WebMock::Util::URI.variations_of_uri_as_strings(uri).sort.should == URIS_WITHOUT_PATH_OR_PARAMS
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should find all variations of the same uri for all variations of uri with auth" do
|
101
|
+
URIS_WITH_AUTH.each do |uri|
|
102
|
+
WebMock::Util::URI.variations_of_uri_as_strings(uri).sort.should == URIS_WITH_AUTH
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should find all variations of the same uri for all variations of uri with different port" do
|
107
|
+
URIS_WITH_DIFFERENT_PORT.each do |uri|
|
108
|
+
WebMock::Util::URI.variations_of_uri_as_strings(uri).sort.should == URIS_WITH_DIFFERENT_PORT
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should find all variations of the same uri for all variations of https uris" do
|
113
|
+
URIS_FOR_HTTPS.each do |uri|
|
114
|
+
WebMock::Util::URI.variations_of_uri_as_strings(uri).sort.should == URIS_FOR_HTTPS
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
describe "normalized uri equality" do
|
121
|
+
|
122
|
+
it "should successfully compare all variations of the same uri with path and params" do
|
123
|
+
URIS_WITH_PATH_AND_PARAMS.each do |uri_a|
|
124
|
+
URIS_WITH_PATH_AND_PARAMS.each do |uri_b|
|
125
|
+
WebMock::Util::URI.normalize_uri(uri_a).should === WebMock::Util::URI.normalize_uri(uri_b)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
it "should successfully compare all variations of the same uri with path but with params" do
|
131
|
+
URIS_WITHOUT_PATH_BUT_WITH_PARAMS.each do |uri_a|
|
132
|
+
URIS_WITHOUT_PATH_BUT_WITH_PARAMS.each do |uri_b|
|
133
|
+
WebMock::Util::URI.normalize_uri(uri_a).should === WebMock::Util::URI.normalize_uri(uri_b)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should successfully compare all variations of the same uri without path or params" do
|
139
|
+
URIS_WITHOUT_PATH_OR_PARAMS.each do |uri_a|
|
140
|
+
URIS_WITHOUT_PATH_OR_PARAMS.each do |uri_b|
|
141
|
+
WebMock::Util::URI.normalize_uri(uri_a).should === WebMock::Util::URI.normalize_uri(uri_b)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should successfully compare all variations of the same uri with authority" do
|
147
|
+
URIS_WITH_AUTH.each do |uri_a|
|
148
|
+
URIS_WITH_AUTH.each do |uri_b|
|
149
|
+
WebMock::Util::URI.normalize_uri(uri_a).should === WebMock::Util::URI.normalize_uri(uri_b)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
it "should successfully compare all variations of the same uri custom port" do
|
155
|
+
URIS_WITH_DIFFERENT_PORT.each do |uri_a|
|
156
|
+
URIS_WITH_DIFFERENT_PORT.each do |uri_b|
|
157
|
+
WebMock::Util::URI.normalize_uri(uri_a).should === WebMock::Util::URI.normalize_uri(uri_b)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
it "should successfully compare all variations of the same https uri" do
|
163
|
+
URIS_FOR_HTTPS.each do |uri_a|
|
164
|
+
URIS_FOR_HTTPS.each do |uri_b|
|
165
|
+
WebMock::Util::URI.normalize_uri(uri_a).should === WebMock::Util::URI.normalize_uri(uri_b)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
it "should successfully handle array parameters" do
|
171
|
+
uri_string = 'http://www.example.com:80/path?a[]=b&a[]=c'
|
172
|
+
uri = WebMock::Util::URI.normalize_uri(uri_string)
|
173
|
+
uri.query_values.should == {"a"=>["b", "c"]}
|
174
|
+
end
|
175
|
+
|
176
|
+
it "should successfully handle hash parameters" do
|
177
|
+
uri_string = 'http://www.example.com:80/path?a[d]=b&a[e]=c&a[b][c]=1'
|
178
|
+
uri = WebMock::Util::URI.normalize_uri(uri_string)
|
179
|
+
uri.query_values.should == {"a"=>{"d"=>"b", "e"=>"c", "b"=>{"c"=>"1"}}}
|
180
|
+
end
|
181
|
+
|
182
|
+
it "should successfully handle nested hash parameters" do
|
183
|
+
uri_string = 'http://www.example.com:80/path?one[two][three][]=four&one[two][three][]=five'
|
184
|
+
uri = WebMock::Util::URI.normalize_uri(uri_string)
|
185
|
+
uri.query_values.should == {"one"=>{"two"=>{"three" => ["four", "five"]}}}
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
describe "stripping default port" do
|
190
|
+
|
191
|
+
it "should strip_default_port_from_uri strips 80 from http with path" do
|
192
|
+
uri = "http://example.com:80/foo/bar"
|
193
|
+
stripped_uri = WebMock::Util::URI.strip_default_port_from_uri_string(uri)
|
194
|
+
stripped_uri.should == "http://example.com/foo/bar"
|
195
|
+
end
|
196
|
+
|
197
|
+
it "should strip_default_port_from_uri strips 80 from http without path" do
|
198
|
+
uri = "http://example.com:80"
|
199
|
+
stripped_uri = WebMock::Util::URI.strip_default_port_from_uri_string(uri)
|
200
|
+
stripped_uri.should == "http://example.com"
|
201
|
+
end
|
202
|
+
|
203
|
+
it "should strip_default_port_from_uri strips 443 from https without path" do
|
204
|
+
uri = "https://example.com:443"
|
205
|
+
stripped_uri = WebMock::Util::URI.strip_default_port_from_uri_string(uri)
|
206
|
+
stripped_uri.should == "https://example.com"
|
207
|
+
end
|
208
|
+
|
209
|
+
it "should strip_default_port_from_uri strips 443 from https" do
|
210
|
+
uri = "https://example.com:443/foo/bar"
|
211
|
+
stripped_uri = WebMock::Util::URI.strip_default_port_from_uri_string(uri)
|
212
|
+
stripped_uri.should == "https://example.com/foo/bar"
|
213
|
+
end
|
214
|
+
|
215
|
+
it "should strip_default_port_from_uri does not strip 8080 from http" do
|
216
|
+
uri = "http://example.com:8080/foo/bar"
|
217
|
+
WebMock::Util::URI.strip_default_port_from_uri_string(uri).should == uri
|
218
|
+
end
|
219
|
+
|
220
|
+
it "should strip_default_port_from_uri does not strip 443 from http" do
|
221
|
+
uri = "http://example.com:443/foo/bar"
|
222
|
+
WebMock::Util::URI.strip_default_port_from_uri_string(uri).should == uri
|
223
|
+
end
|
224
|
+
|
225
|
+
it "should strip_default_port_from_uri does not strip 80 from query string" do
|
226
|
+
uri = "http://example.com/?a=:80&b=c"
|
227
|
+
WebMock::Util::URI.strip_default_port_from_uri_string(uri).should == uri
|
228
|
+
end
|
229
|
+
|
230
|
+
it "should strip_default_port_from_uri does not modify strings that do not start with http or https" do
|
231
|
+
uri = "httpz://example.com:80/"
|
232
|
+
WebMock::Util::URI.strip_default_port_from_uri_string(uri).should == uri
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
236
|
+
|
237
|
+
|
238
|
+
describe "encoding userinfo" do
|
239
|
+
|
240
|
+
it "should encode unsafe chars in userinfo does not encode userinfo safe punctuation" do
|
241
|
+
userinfo = "user;&=+$,:secret"
|
242
|
+
WebMock::Util::URI.encode_unsafe_chars_in_userinfo(userinfo).should == userinfo
|
243
|
+
end
|
244
|
+
|
245
|
+
it "should encode unsafe chars in userinfo does not encode rfc 3986 unreserved characters" do
|
246
|
+
userinfo = "-.!~*'()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:secret"
|
247
|
+
WebMock::Util::URI.encode_unsafe_chars_in_userinfo(userinfo).should == userinfo
|
248
|
+
end
|
249
|
+
|
250
|
+
it "should encode unsafe chars in userinfo does encode other characters" do
|
251
|
+
userinfo, safe_userinfo = 'us#rn@me:sec//ret?"', 'us%23rn%40me:sec%2F%2Fret%3F%22'
|
252
|
+
WebMock::Util::URI.encode_unsafe_chars_in_userinfo(userinfo).should == safe_userinfo
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module WebMock
|
4
|
+
describe VersionChecker do
|
5
|
+
it 'prints a warning if the major version is too low' do
|
6
|
+
checker = VersionChecker.new('foo', '0.7.3', '1.0.0', '1.1')
|
7
|
+
Kernel.should_receive(:warn).with("\e[31mYou are using foo 0.7.3. WebMock supports version >= 1.0.0, < 1.2.\e[0m")
|
8
|
+
checker.check_version!
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'prints a warning if the minor version is too low' do
|
12
|
+
checker = VersionChecker.new('foo', '1.0.99', '1.1.3', '1.2')
|
13
|
+
Kernel.should_receive(:warn).with("\e[31mYou are using foo 1.0.99. WebMock supports version >= 1.1.3, < 1.3.\e[0m")
|
14
|
+
checker.check_version!
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'prints a warning if the patch version is too low' do
|
18
|
+
checker = VersionChecker.new('foo', '1.0.8', '1.0.10', '1.2')
|
19
|
+
Kernel.should_receive(:warn).with("\e[31mYou are using foo 1.0.8. WebMock supports version >= 1.0.10, < 1.3.\e[0m")
|
20
|
+
checker.check_version!
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'prints a warning if the patch version is too low and max version is not specified' do
|
24
|
+
checker = VersionChecker.new('foo', '1.0.8', '1.0.10')
|
25
|
+
Kernel.should_receive(:warn).with("\e[31mYou are using foo 1.0.8. WebMock supports version >= 1.0.10.\e[0m")
|
26
|
+
checker.check_version!
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'prints a warning if the major version is too high' do
|
30
|
+
checker = VersionChecker.new('foo', '2.0.0', '1.0.0', '1.1')
|
31
|
+
Kernel.should_receive(:warn).with(/may not work with this version/)
|
32
|
+
checker.check_version!
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'prints a warning if the minor version is too high' do
|
36
|
+
checker = VersionChecker.new('foo', '1.2.0', '1.0.0', '1.1')
|
37
|
+
Kernel.should_receive(:warn).with(/may not work with this version/)
|
38
|
+
checker.check_version!
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'does not raise an error or print a warning when the major version is between the min and max' do
|
42
|
+
checker = VersionChecker.new('foo', '2.0.0', '1.0.0', '3.0')
|
43
|
+
Kernel.should_not_receive(:warn)
|
44
|
+
checker.check_version!
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'does not raise an error or print a warning when the min_patch is 0.6.5, the max_minor is 0.7 and the version is 0.7.3' do
|
48
|
+
checker = VersionChecker.new('foo', '0.7.3', '0.6.5', '0.7')
|
49
|
+
Kernel.should_not_receive(:warn)
|
50
|
+
checker.check_version!
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'does not raise an error or print a warning when the min_patch is 0.6.5, the max_minor is not specified and the version is 0.8.3' do
|
54
|
+
checker = VersionChecker.new('foo', '0.8.3', '0.6.5')
|
55
|
+
Kernel.should_not_receive(:warn)
|
56
|
+
checker.check_version!
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
|
3
|
+
module HttpRequestTestHelper
|
4
|
+
def http_request(method, uri, options = {})
|
5
|
+
begin
|
6
|
+
uri = URI.parse(uri)
|
7
|
+
rescue
|
8
|
+
uri = Addressable::URI.heuristic_parse(uri)
|
9
|
+
end
|
10
|
+
response = nil
|
11
|
+
clazz = ::Net::HTTP.const_get("#{method.to_s.capitalize}")
|
12
|
+
req = clazz.new("#{uri.path}#{uri.query ? '?' : ''}#{uri.query}", options[:headers])
|
13
|
+
req.basic_auth uri.user, uri.password if uri.user
|
14
|
+
http = ::Net::HTTP.new(uri.host, uri.port)
|
15
|
+
http.use_ssl = true if uri.scheme == "https"
|
16
|
+
response = http.start {|http|
|
17
|
+
http.request(req, options[:body])
|
18
|
+
}
|
19
|
+
OpenStruct.new({
|
20
|
+
:body => response.body,
|
21
|
+
:headers => response,
|
22
|
+
:status => response.code })
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/http_request')
|
2
|
+
|
3
|
+
module SharedTest
|
4
|
+
include HttpRequestTestHelper
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@stub_http = stub_http_request(:any, "http://www.example.com")
|
9
|
+
@stub_https = stub_http_request(:any, "https://www.example.com")
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_error_on_non_stubbed_request
|
13
|
+
default_ruby_headers = (RUBY_VERSION >= "1.9.1") ? "{'Accept'=>'*/*', 'User-Agent'=>'Ruby'}" : "{'Accept'=>'*/*'}"
|
14
|
+
assert_raise_with_message(WebMock::NetConnectNotAllowedError, %r{Real HTTP connections are disabled. Unregistered request: GET http://www.example.net/ with headers}) do
|
15
|
+
http_request(:get, "http://www.example.net/")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_verification_that_expected_request_occured
|
20
|
+
http_request(:get, "http://www.example.com/")
|
21
|
+
assert_requested(:get, "http://www.example.com", :times => 1)
|
22
|
+
assert_requested(:get, "http://www.example.com")
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_verification_that_expected_stub_occured
|
26
|
+
http_request(:get, "http://www.example.com/")
|
27
|
+
assert_requested(@stub_http, :times => 1)
|
28
|
+
assert_requested(@stub_http)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_verification_that_expected_request_didnt_occur
|
32
|
+
expected_message = "The request GET http://www.example.com/ was expected to execute 1 time but it executed 0 times"
|
33
|
+
expected_message << "\n\nThe following requests were made:\n\nNo requests were made.\n============================================================"
|
34
|
+
assert_fail(expected_message) do
|
35
|
+
assert_requested(:get, "http://www.example.com")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_verification_that_expected_request_didnt_occur
|
40
|
+
expected_message = "The request ANY http://www.example.com/ was expected to execute 1 time but it executed 0 times"
|
41
|
+
expected_message << "\n\nThe following requests were made:\n\nNo requests were made.\n============================================================"
|
42
|
+
assert_fail(expected_message) do
|
43
|
+
assert_requested(@stub_http)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_verification_that_expected_request_occured_with_body_and_headers
|
48
|
+
http_request(:get, "http://www.example.com/",
|
49
|
+
:body => "abc", :headers => {'A' => 'a'})
|
50
|
+
assert_requested(:get, "http://www.example.com",
|
51
|
+
:body => "abc", :headers => {'A' => 'a'})
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_verification_that_expected_request_occured_with_query_params
|
55
|
+
stub_request(:any, "http://www.example.com").with(:query => hash_including({"a" => ["b", "c"]}))
|
56
|
+
http_request(:get, "http://www.example.com/?a[]=b&a[]=c&x=1")
|
57
|
+
assert_requested(:get, "http://www.example.com",
|
58
|
+
:query => hash_including({"a" => ["b", "c"]}))
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_verification_that_non_expected_request_didnt_occur
|
62
|
+
expected_message = %r(The request GET http://www.example.com/ was expected to execute 0 times but it executed 1 time\n\nThe following requests were made:\n\nGET http://www.example.com/ with headers .+ was made 1 time\n\n============================================================)
|
63
|
+
assert_fail(expected_message) do
|
64
|
+
http_request(:get, "http://www.example.com/")
|
65
|
+
assert_not_requested(:get, "http://www.example.com")
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_verification_that_non_expected_stub_didnt_occur
|
70
|
+
expected_message = %r(The request ANY http://www.example.com/ was expected to execute 0 times but it executed 1 time\n\nThe following requests were made:\n\nGET http://www.example.com/ with headers .+ was made 1 time\n\n============================================================)
|
71
|
+
assert_fail(expected_message) do
|
72
|
+
http_request(:get, "http://www.example.com/")
|
73
|
+
assert_not_requested(@stub_http)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
4
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
5
|
+
|
6
|
+
require 'webmock/test_unit'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class Test::Unit::TestCase
|
10
|
+
AssertionFailedError = Test::Unit::AssertionFailedError rescue MiniTest::Assertion
|
11
|
+
def assert_raise_with_message(e, message, &block)
|
12
|
+
e = assert_raise(e, &block)
|
13
|
+
if message.is_a?(Regexp)
|
14
|
+
assert_match(message, e.message)
|
15
|
+
else
|
16
|
+
assert_equal(message, e.message)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def assert_fail(message, &block)
|
21
|
+
assert_raise_with_message(AssertionFailedError, message, &block)
|
22
|
+
end
|
23
|
+
end
|