webmock 1.22.1 → 1.22.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.
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.22.2
4
+
5
+ * Fix: prevents adding an extra =true to urls with parameters without values
6
+
7
+ Thanks to [David Begin](https://github.com/davidbegin)
8
+
3
9
  ## 1.22.1
4
10
 
5
11
  * Adds Rack as a development dependency and removes require rack/utils in main lib.
@@ -79,7 +79,7 @@ module WebMock::Util
79
79
  def collect_query_hash(query_array, empty_accumulator, options)
80
80
  query_array.compact.inject(empty_accumulator.dup) do |accumulator, (key, value)|
81
81
  value = if value.nil?
82
- true
82
+ nil
83
83
  else
84
84
  ::Addressable::URI.unencode_component(value.gsub(/\+/, ' '))
85
85
  end
@@ -263,6 +263,8 @@ module WebMock::Util
263
263
  buffer << "#{to_query(new_parent, val, options)}&"
264
264
  end
265
265
  buffer.chop
266
+ when NilClass
267
+ parent
266
268
  else
267
269
  encoded_value = Addressable::URI.encode_component(
268
270
  value.to_s.dup, Addressable::URI::CharacterClasses::UNRESERVED
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '1.22.1' unless defined?(::WebMock::VERSION)
2
+ VERSION = '1.22.2' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -52,7 +52,7 @@ describe WebMock::Util::QueryMapper do
52
52
 
53
53
  context '#to_query' do
54
54
  it 'should transform nil value' do
55
- expect(subject.to_query('a', nil)).to eq('a=')
55
+ expect(subject.to_query('a', nil)).to eq('a')
56
56
  end
57
57
  it 'should transform string value' do
58
58
  expect(subject.to_query('a', 'b')).to eq('a=b')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- hash: 77
4
+ hash: 75
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 22
9
- - 1
10
- version: 1.22.1
9
+ - 2
10
+ version: 1.22.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bartosz Blimke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2015-10-13 00:00:00 +02:00
18
+ date: 2015-10-29 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency