webstub 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dab6a7224711a9b346e0e025185c193232f48544
4
- data.tar.gz: 78f95e5a74f4daac8dd0790a9c97f3ab22f2b8ae
3
+ metadata.gz: 3a2fde9e9d4804340eb7277944fb7eb0209a15c8
4
+ data.tar.gz: 48037f7211c379455be860d31f6f1a62fecbe422
5
5
  SHA512:
6
- metadata.gz: 0343926f70ed862ed33181cfd96c7ce9e9411935f7aea4fe7d0feb78e87dd3066dc8ec0447cecc40f69f2a1d0c5544b5e6111af161640573c0d883626c9f5e2c
7
- data.tar.gz: 5d12d87852b07ec5c21cbe9d3fba3fc48562cd7b583c185a1138371de5fea8f321a4f7cec579c17416dc87f9dba40df950b6300fe4ecaeaa9f66db223efebf0e
6
+ metadata.gz: 0d5d5de8974ee5fa30d38d6c8092d4c42ef1b8bccf6bead31678fc44141a069fcc39174f7d0e19ce210141f8a6c58b69a64d85c2da0f429c67d28d0d99023cca
7
+ data.tar.gz: cdfae6a5dd49a258865d8374041836a4202ceedf98b5598a052df91338cd639e1a6cbcd63b3ef863191a1c269a1f3ec8a144fc4264559f801f5f3007a31b5d05
data/lib/webstub/stub.rb CHANGED
@@ -181,7 +181,7 @@ module WebStub
181
181
  end
182
182
 
183
183
  if query && !query.empty?
184
- q = query.chomp("&")
184
+ q = query.split("&").sort.join("&")
185
185
  parts << "?#{q}"
186
186
  end
187
187
 
@@ -1,3 +1,3 @@
1
1
  module WebStub
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
data/spec/stub_spec.rb CHANGED
@@ -102,15 +102,19 @@ describe WebStub::Stub do
102
102
 
103
103
  describe "query string" do
104
104
  before do
105
- @stub = WebStub::Stub.new(:get, "http://www.yahoo.com/search?count=1")
105
+ @stub = WebStub::Stub.new(:get, "http://www.yahoo.com/search?count=1&q=whiskey")
106
106
  end
107
107
 
108
108
  it "returns true when the query string matches" do
109
- @stub.matches?(:get, "http://www.yahoo.com/search?count=1").should.be.true
109
+ @stub.matches?(:get, "http://www.yahoo.com/search?count=1&q=whiskey").should.be.true
110
110
  end
111
111
 
112
112
  it "strips any trailing &" do
113
- @stub.matches?(:get, "http://www.yahoo.com/search?count=1&").should.be.true
113
+ @stub.matches?(:get, "http://www.yahoo.com/search?count=1&q=whiskey&").should.be.true
114
+ end
115
+
116
+ it "does not depend on the order of query parameters" do
117
+ @stub.matches?(:get, "http://www.yahoo.com/search?q=whiskey&count=1").should.be.true
114
118
  end
115
119
  end
116
120
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webstub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Green
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-21 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake