webmock 2.3.1 → 2.3.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.
- checksums.yaml +4 -4
 - data/.travis.yml +7 -3
 - data/CHANGELOG.md +6 -0
 - data/README.md +3 -1
 - data/lib/webmock/http_lib_adapters/net_http.rb +18 -1
 - data/lib/webmock/test_unit.rb +1 -1
 - data/lib/webmock/util/json.rb +15 -5
 - data/lib/webmock/version.rb +1 -1
 - data/spec/acceptance/httpclient/httpclient_spec_helper.rb +1 -0
 - data/spec/acceptance/shared/stubbing_requests.rb +1 -1
 - data/webmock.gemspec +3 -3
 - metadata +8 -8
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: c1069c0a60e8b12e1b55267f15e1e4fb3d57835b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 2cc2741c7f3a459e1f861d2975a71b5faa2a97a8
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ed37a77fc5f8f16a5d672439a576a977d01dc930455cbe8e3acd65ad571c368597cbcfb21b98c8cb6f6173e877a8a955e4879ba62d73592e36f723594f45e00e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 6c9d14043a5f3fd8f359a6b4750c045c65b80c32fd8028c004f10b78fa80c586a2d81c21f1ac4ed6d6d1fba318c8c5ef071f54f5c665d3064c35157eda9dcb8a
         
     | 
    
        data/.travis.yml
    CHANGED
    
    | 
         @@ -1,17 +1,21 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            rvm:
         
     | 
| 
      
 2 
     | 
    
         
            +
              - 1.9.3
         
     | 
| 
       2 
3 
     | 
    
         
             
              - 2.0.0
         
     | 
| 
       3 
4 
     | 
    
         
             
              - 2.1.0
         
     | 
| 
       4 
5 
     | 
    
         
             
              - 2.2.1
         
     | 
| 
       5 
6 
     | 
    
         
             
              - 2.2.3
         
     | 
| 
       6 
7 
     | 
    
         
             
              - 2.3.0
         
     | 
| 
       7 
     | 
    
         
            -
              -  
     | 
| 
      
 8 
     | 
    
         
            +
              - 2.4.0
         
     | 
| 
       8 
9 
     | 
    
         
             
              - rbx-2
         
     | 
| 
       9 
10 
     | 
    
         
             
              - ruby-head
         
     | 
| 
       10 
     | 
    
         
            -
              - jruby-9.0. 
     | 
| 
       11 
     | 
    
         
            -
              - jruby-9.1. 
     | 
| 
      
 11 
     | 
    
         
            +
              - jruby-9.0.0.0
         
     | 
| 
      
 12 
     | 
    
         
            +
              - jruby-9.0.1.0
         
     | 
| 
      
 13 
     | 
    
         
            +
              - jruby-19mode
         
     | 
| 
      
 14 
     | 
    
         
            +
              - jruby
         
     | 
| 
       12 
15 
     | 
    
         
             
              - jruby-head
         
     | 
| 
       13 
16 
     | 
    
         
             
            matrix:
         
     | 
| 
       14 
17 
     | 
    
         
             
              allow_failures:
         
     | 
| 
      
 18 
     | 
    
         
            +
                - rvm: jruby-9.0.0.0
         
     | 
| 
       15 
19 
     | 
    
         
             
                - rvm: jruby-head
         
     | 
| 
       16 
20 
     | 
    
         
             
                - rvm: ruby-head
         
     | 
| 
       17 
21 
     | 
    
         
             
                - rvm: rbx-2
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -32,7 +32,8 @@ Supported HTTP libraries 
     | 
|
| 
       32 
32 
     | 
    
         
             
            Supported Ruby Interpreters
         
     | 
| 
       33 
33 
     | 
    
         
             
            ---------------------------
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
            * MRI  
     | 
| 
      
 35 
     | 
    
         
            +
            * MRI 1.9.3
         
     | 
| 
      
 36 
     | 
    
         
            +
            * MRI 2.0.0
         
     | 
| 
       36 
37 
     | 
    
         
             
            * MRI 2.1
         
     | 
| 
       37 
38 
     | 
    
         
             
            * MRI 2.2
         
     | 
| 
       38 
39 
     | 
    
         
             
            * MRI 2.3
         
     | 
| 
         @@ -1027,6 +1028,7 @@ People who submitted patches and new features or suggested improvements. Many th 
     | 
|
| 
       1027 
1028 
     | 
    
         
             
            * Aleksei Maridashvili
         
     | 
| 
       1028 
1029 
     | 
    
         
             
            * Ville Lautanala
         
     | 
| 
       1029 
1030 
     | 
    
         
             
            * Koichi ITO
         
     | 
| 
      
 1031 
     | 
    
         
            +
            * Jordan Harband
         
     | 
| 
       1030 
1032 
     | 
    
         | 
| 
       1031 
1033 
     | 
    
         
             
            For a full list of contributors you can visit the
         
     | 
| 
       1032 
1034 
     | 
    
         
             
            [contributors](https://github.com/bblimke/webmock/contributors) page.
         
     | 
| 
         @@ -183,6 +183,9 @@ module WebMock 
     | 
|
| 
       183 
183 
     | 
    
         
             
                      if defined?(Net::OpenTimeout)
         
     | 
| 
       184 
184 
     | 
    
         
             
                        # Ruby 2.x
         
     | 
| 
       185 
185 
     | 
    
         
             
                        Net::OpenTimeout
         
     | 
| 
      
 186 
     | 
    
         
            +
                      elsif defined?(Net::HTTP::OpenTimeout)
         
     | 
| 
      
 187 
     | 
    
         
            +
                        # Ruby 1.9
         
     | 
| 
      
 188 
     | 
    
         
            +
                        Net::HTTP::OpenTimeout
         
     | 
| 
       186 
189 
     | 
    
         
             
                      else
         
     | 
| 
       187 
190 
     | 
    
         
             
                        # Fallback, if things change
         
     | 
| 
       188 
191 
     | 
    
         
             
                        Timeout::Error
         
     | 
| 
         @@ -256,7 +259,21 @@ end 
     | 
|
| 
       256 
259 
     | 
    
         
             
            module Net  #:nodoc: all
         
     | 
| 
       257 
260 
     | 
    
         | 
| 
       258 
261 
     | 
    
         
             
              class WebMockNetBufferedIO < BufferedIO
         
     | 
| 
       259 
     | 
    
         
            -
                 
     | 
| 
      
 262 
     | 
    
         
            +
                if RUBY_VERSION <= '1.9.3'
         
     | 
| 
      
 263 
     | 
    
         
            +
                  class_eval <<-DEFINE_METHOD
         
     | 
| 
      
 264 
     | 
    
         
            +
                    def initialize(io, debug_output = nil)
         
     | 
| 
      
 265 
     | 
    
         
            +
                      common_initialize(io, debug_output)
         
     | 
| 
      
 266 
     | 
    
         
            +
                    end
         
     | 
| 
      
 267 
     | 
    
         
            +
                  DEFINE_METHOD
         
     | 
| 
      
 268 
     | 
    
         
            +
                else
         
     | 
| 
      
 269 
     | 
    
         
            +
                  class_eval <<-DEFINE_METHOD
         
     | 
| 
      
 270 
     | 
    
         
            +
                    def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
         
     | 
| 
      
 271 
     | 
    
         
            +
                      common_initialize(io, debug_output)
         
     | 
| 
      
 272 
     | 
    
         
            +
                    end
         
     | 
| 
      
 273 
     | 
    
         
            +
                  DEFINE_METHOD
         
     | 
| 
      
 274 
     | 
    
         
            +
                end
         
     | 
| 
      
 275 
     | 
    
         
            +
             
     | 
| 
      
 276 
     | 
    
         
            +
                def common_initialize(io, debug_output = nil)
         
     | 
| 
       260 
277 
     | 
    
         
             
                  @read_timeout = 60
         
     | 
| 
       261 
278 
     | 
    
         
             
                  @rbuf = ''
         
     | 
| 
       262 
279 
     | 
    
         
             
                  @debug_output = debug_output
         
     | 
    
        data/lib/webmock/test_unit.rb
    CHANGED
    
    
    
        data/lib/webmock/util/json.rb
    CHANGED
    
    | 
         @@ -48,11 +48,21 @@ module WebMock 
     | 
|
| 
       48 
48 
     | 
    
         
             
                      right_pos = marks << json.bytesize
         
     | 
| 
       49 
49 
     | 
    
         
             
                      output    = []
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
     | 
    
         
            -
                       
     | 
| 
       52 
     | 
    
         
            -
                         
     | 
| 
       53 
     | 
    
         
            -
                           
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
                           
     | 
| 
      
 51 
     | 
    
         
            +
                      if RUBY_VERSION != "1.9.2"
         
     | 
| 
      
 52 
     | 
    
         
            +
                        left_pos.each_with_index do |left, i|
         
     | 
| 
      
 53 
     | 
    
         
            +
                          if json.respond_to?(:byteslice)
         
     | 
| 
      
 54 
     | 
    
         
            +
                            output << json.byteslice(left.succ..right_pos[i])
         
     | 
| 
      
 55 
     | 
    
         
            +
                          else
         
     | 
| 
      
 56 
     | 
    
         
            +
                            output << json[left.succ..right_pos[i]]
         
     | 
| 
      
 57 
     | 
    
         
            +
                          end
         
     | 
| 
      
 58 
     | 
    
         
            +
                        end
         
     | 
| 
      
 59 
     | 
    
         
            +
                      else
         
     | 
| 
      
 60 
     | 
    
         
            +
                        json_as_binary = json.force_encoding("binary")
         
     | 
| 
      
 61 
     | 
    
         
            +
                        left_pos.each_with_index do |left, i|
         
     | 
| 
      
 62 
     | 
    
         
            +
                          output << json_as_binary[left.succ..right_pos[i]]
         
     | 
| 
      
 63 
     | 
    
         
            +
                        end
         
     | 
| 
      
 64 
     | 
    
         
            +
                        output.map! do |binary_str|
         
     | 
| 
      
 65 
     | 
    
         
            +
                          binary_str.force_encoding("UTF-8")
         
     | 
| 
       56 
66 
     | 
    
         
             
                        end
         
     | 
| 
       57 
67 
     | 
    
         
             
                      end
         
     | 
| 
       58 
68 
     | 
    
         | 
    
        data/lib/webmock/version.rb
    CHANGED
    
    
| 
         @@ -7,6 +7,7 @@ module HTTPClientSpecHelper 
     | 
|
| 
       7 
7 
     | 
    
         
             
                uri = Addressable::URI.heuristic_parse(uri)
         
     | 
| 
       8 
8 
     | 
    
         
             
                c = options.fetch(:client) { HTTPClient.new }
         
     | 
| 
       9 
9 
     | 
    
         
             
                c.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
         
     | 
| 
      
 10 
     | 
    
         
            +
                c.reset_all
         
     | 
| 
       10 
11 
     | 
    
         
             
                if options[:basic_auth]
         
     | 
| 
       11 
12 
     | 
    
         
             
                  c.force_basic_auth = true
         
     | 
| 
       12 
13 
     | 
    
         
             
                  c.set_basic_auth(nil, options[:basic_auth][0], options[:basic_auth][1])
         
     | 
| 
         @@ -18,7 +18,7 @@ shared_examples_for "stubbing requests" do |*adapter_info| 
     | 
|
| 
       18 
18 
     | 
    
         
             
                    expect(http_request(:get, "http://www.example.com/hello+/?#{NOT_ESCAPED_PARAMS}").body).to eq("abc")
         
     | 
| 
       19 
19 
     | 
    
         
             
                  end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                  it "should return stubbed response for url with non utf query params" do
         
     | 
| 
      
 21 
     | 
    
         
            +
                  it "should return stubbed response for url with non utf query params", "ruby>1.9" => true do
         
     | 
| 
       22 
22 
     | 
    
         
             
                    param = 'aäoöuü'.encode('iso-8859-1')
         
     | 
| 
       23 
23 
     | 
    
         
             
                    param = CGI.escape(param)
         
     | 
| 
       24 
24 
     | 
    
         
             
                    stub_request(:get, "www.example.com/?#{param}").to_return(body: "abc")
         
     | 
    
        data/webmock.gemspec
    CHANGED
    
    | 
         @@ -15,9 +15,9 @@ Gem::Specification.new do |s| 
     | 
|
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
              s.rubyforge_project = 'webmock'
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
              s.required_ruby_version = '>=  
     | 
| 
      
 18 
     | 
    
         
            +
              s.required_ruby_version = '>= 1.9.3'
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
              s.add_dependency 'addressable', '>= 2.3.6'
         
     | 
| 
      
 20 
     | 
    
         
            +
              s.add_dependency 'addressable', '>= 2.3.6', ('<= 2.4.0' if RUBY_VERSION <= '1.9.3')
         
     | 
| 
       21 
21 
     | 
    
         
             
              s.add_dependency 'crack', '>= 0.3.2'
         
     | 
| 
       22 
22 
     | 
    
         
             
              s.add_dependency 'hashdiff'
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
         @@ -27,7 +27,7 @@ Gem::Specification.new do |s| 
     | 
|
| 
       27 
27 
     | 
    
         
             
                s.add_development_dependency 'typhoeus', '>= 0.5.0'
         
     | 
| 
       28 
28 
     | 
    
         
             
              end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
              s.add_development_dependency 'http',            '>= 0.8.0'
         
     | 
| 
      
 30 
     | 
    
         
            +
              s.add_development_dependency 'http',            ((RUBY_VERSION <= '1.9.3') ? '0.7.3' : '>= 0.8.0')
         
     | 
| 
       31 
31 
     | 
    
         
             
              s.add_development_dependency 'manticore',       '>= 0.5.1' if RUBY_PLATFORM =~ /java/
         
     | 
| 
       32 
32 
     | 
    
         
             
              s.add_development_dependency 'rack',            ((RUBY_VERSION < '2.2.2') ? '1.6.0' : '> 1.6')
         
     | 
| 
       33 
33 
     | 
    
         
             
              s.add_development_dependency 'rspec',           '>= 3.1.0'
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: webmock
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.3.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Bartosz Blimke
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-01-01 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: addressable
         
     | 
| 
         @@ -112,16 +112,16 @@ dependencies: 
     | 
|
| 
       112 
112 
     | 
    
         
             
              name: rack
         
     | 
| 
       113 
113 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       114 
114 
     | 
    
         
             
                requirements:
         
     | 
| 
       115 
     | 
    
         
            -
                - -  
     | 
| 
      
 115 
     | 
    
         
            +
                - - ">"
         
     | 
| 
       116 
116 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       117 
     | 
    
         
            -
                    version: 1.6 
     | 
| 
      
 117 
     | 
    
         
            +
                    version: '1.6'
         
     | 
| 
       118 
118 
     | 
    
         
             
              type: :development
         
     | 
| 
       119 
119 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       120 
120 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       121 
121 
     | 
    
         
             
                requirements:
         
     | 
| 
       122 
     | 
    
         
            -
                - -  
     | 
| 
      
 122 
     | 
    
         
            +
                - - ">"
         
     | 
| 
       123 
123 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       124 
     | 
    
         
            -
                    version: 1.6 
     | 
| 
      
 124 
     | 
    
         
            +
                    version: '1.6'
         
     | 
| 
       125 
125 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       126 
126 
     | 
    
         
             
              name: rspec
         
     | 
| 
       127 
127 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -386,7 +386,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       386 
386 
     | 
    
         
             
              requirements:
         
     | 
| 
       387 
387 
     | 
    
         
             
              - - ">="
         
     | 
| 
       388 
388 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       389 
     | 
    
         
            -
                  version:  
     | 
| 
      
 389 
     | 
    
         
            +
                  version: 1.9.3
         
     | 
| 
       390 
390 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       391 
391 
     | 
    
         
             
              requirements:
         
     | 
| 
       392 
392 
     | 
    
         
             
              - - ">="
         
     | 
| 
         @@ -394,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       394 
394 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       395 
395 
     | 
    
         
             
            requirements: []
         
     | 
| 
       396 
396 
     | 
    
         
             
            rubyforge_project: webmock
         
     | 
| 
       397 
     | 
    
         
            -
            rubygems_version: 2. 
     | 
| 
      
 397 
     | 
    
         
            +
            rubygems_version: 2.6.8
         
     | 
| 
       398 
398 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       399 
399 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       400 
400 
     | 
    
         
             
            summary: Library for stubbing HTTP requests in Ruby.
         
     |