webmock 1.8.6 → 1.8.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.8.7
4
+
5
+ * Compatibility with RSpec >= 2.10
6
+
7
+ Thanks to [erwanlr](https://github.com/erwanlr) for reporting this issue.
8
+
9
+ * Add missing required rack environment variable SCRIPT_NAME
10
+
11
+ Thanks to [Eric Oestrich](https://github.com/oestrich)
12
+
13
+ * Fixed warnings due to @query_params not being initialized
14
+
15
+ Thanks to [Ben Bleything](https://github.com/bleything)
16
+
3
17
  ## 1.8.6
4
18
 
5
19
  * Pass through SERVER_PORT when stubbing to rack
data/README.md CHANGED
@@ -705,6 +705,8 @@ People who submitted patches and new features or suggested improvements. Many th
705
705
  * jugyo
706
706
  * aindustries
707
707
  * Eric Oestrich
708
+ * erwanlr
709
+ * Ben Bleything
708
710
 
709
711
  For a full list of contributors you can visit the
710
712
  [contributors](https://github.com/bblimke/webmock/contributors) page.
@@ -36,7 +36,8 @@ module WebMock
36
36
  'PATH_INFO' => uri.path,
37
37
  'QUERY_STRING' => uri.query || '',
38
38
  'SERVER_NAME' => uri.host,
39
- 'SERVER_PORT' => uri.port
39
+ 'SERVER_PORT' => uri.port,
40
+ 'SCRIPT_NAME' => ""
40
41
  }
41
42
 
42
43
  env['HTTP_AUTHORIZATION'] = 'Basic ' + [uri.userinfo].pack('m').delete("\r\n") if uri.userinfo
@@ -83,6 +83,7 @@ module WebMock
83
83
 
84
84
  def initialize(pattern)
85
85
  @pattern = pattern.is_a?(Addressable::URI) ? pattern : WebMock::Util::URI.normalize_uri(pattern)
86
+ @query_params = nil
86
87
  end
87
88
 
88
89
  def add_query_params(query_params)
@@ -105,11 +106,6 @@ module WebMock
105
106
  end
106
107
 
107
108
  class URIRegexpPattern < URIPattern
108
- def initialize *args, &block
109
- @query_params = nil
110
- super
111
- end
112
-
113
109
  def matches?(uri)
114
110
  WebMock::Util::URI.variations_of_uri_as_strings(uri).any? { |u| u.match(@pattern) } &&
115
111
  (@query_params.nil? || @query_params == uri.query_values)
data/lib/webmock/rspec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'webmock'
2
2
 
3
3
  # RSpec 1.x and 2.x compatibility
4
- if defined?(RSpec) && defined?(RSpec::Expectations)
4
+ if defined?(RSpec::Expectations::ExpectationNotMetError)
5
5
  RSPEC_NAMESPACE = RSPEC_CONFIGURER = RSpec
6
6
  elsif defined?(Spec) && defined?(Spec.configure)
7
7
  RSPEC_NAMESPACE = Spec
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '1.8.6' unless defined?(::WebMock::VERSION)
2
+ VERSION = '1.8.7' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -27,7 +27,7 @@ class MyRackApp
27
27
  name = env["rack.input"].read[/name=([^&]*)/, 1] || "World"
28
28
  [200, {}, ["Good to meet you, #{name}!"]]
29
29
  when ['GET', '/compute']
30
- if env['SERVER_PORT'] == 80
30
+ if env['SERVER_PORT'] == 80 && env["SCRIPT_NAME"] == ""
31
31
  [200, {}, [""]]
32
32
  else
33
33
  [401, {}, [""]]
data/webmock.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency 'addressable', '>= 2.2.7'
18
18
  s.add_dependency 'crack', '>=0.1.7'
19
19
 
20
- s.add_development_dependency 'rspec', '~> 2.8'
20
+ s.add_development_dependency 'rspec', '~> 2.10'
21
21
  s.add_development_dependency 'httpclient', '>= 2.2.4'
22
22
  s.add_development_dependency 'patron', '>= 0.4.18' unless RUBY_PLATFORM =~ /java/
23
23
  s.add_development_dependency 'em-http-request', '>= 1.0.2'
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: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 6
10
- version: 1.8.6
9
+ - 7
10
+ version: 1.8.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bartosz Blimke
@@ -15,11 +15,12 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-04 00:00:00 Z
18
+ date: 2012-05-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: addressable
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
23
24
  none: false
24
25
  requirements:
25
26
  - - ">="
@@ -31,11 +32,11 @@ dependencies:
31
32
  - 7
32
33
  version: 2.2.7
33
34
  type: :runtime
34
- prerelease: false
35
- requirement: *id001
35
+ version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: crack
38
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
41
42
  - - ">="
@@ -47,26 +48,26 @@ dependencies:
47
48
  - 7
48
49
  version: 0.1.7
49
50
  type: :runtime
50
- prerelease: false
51
- requirement: *id002
51
+ version_requirements: *id002
52
52
  - !ruby/object:Gem::Dependency
53
53
  name: rspec
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
55
56
  none: false
56
57
  requirements:
57
58
  - - ~>
58
59
  - !ruby/object:Gem::Version
59
- hash: 19
60
+ hash: 23
60
61
  segments:
61
62
  - 2
62
- - 8
63
- version: "2.8"
63
+ - 10
64
+ version: "2.10"
64
65
  type: :development
65
- prerelease: false
66
- requirement: *id003
66
+ version_requirements: *id003
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: httpclient
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
69
+ prerelease: false
70
+ requirement: &id004 !ruby/object:Gem::Requirement
70
71
  none: false
71
72
  requirements:
72
73
  - - ">="
@@ -78,11 +79,11 @@ dependencies:
78
79
  - 4
79
80
  version: 2.2.4
80
81
  type: :development
81
- prerelease: false
82
- requirement: *id004
82
+ version_requirements: *id004
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: patron
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
85
+ prerelease: false
86
+ requirement: &id005 !ruby/object:Gem::Requirement
86
87
  none: false
87
88
  requirements:
88
89
  - - ">="
@@ -94,11 +95,11 @@ dependencies:
94
95
  - 18
95
96
  version: 0.4.18
96
97
  type: :development
97
- prerelease: false
98
- requirement: *id005
98
+ version_requirements: *id005
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: em-http-request
101
- version_requirements: &id006 !ruby/object:Gem::Requirement
101
+ prerelease: false
102
+ requirement: &id006 !ruby/object:Gem::Requirement
102
103
  none: false
103
104
  requirements:
104
105
  - - ">="
@@ -110,11 +111,11 @@ dependencies:
110
111
  - 2
111
112
  version: 1.0.2
112
113
  type: :development
113
- prerelease: false
114
- requirement: *id006
114
+ version_requirements: *id006
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: curb
117
- version_requirements: &id007 !ruby/object:Gem::Requirement
117
+ prerelease: false
118
+ requirement: &id007 !ruby/object:Gem::Requirement
118
119
  none: false
119
120
  requirements:
120
121
  - - ">="
@@ -126,11 +127,11 @@ dependencies:
126
127
  - 0
127
128
  version: 0.8.0
128
129
  type: :development
129
- prerelease: false
130
- requirement: *id007
130
+ version_requirements: *id007
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: typhoeus
133
- version_requirements: &id008 !ruby/object:Gem::Requirement
133
+ prerelease: false
134
+ requirement: &id008 !ruby/object:Gem::Requirement
134
135
  none: false
135
136
  requirements:
136
137
  - - ">="
@@ -142,11 +143,11 @@ dependencies:
142
143
  - 3
143
144
  version: 0.3.3
144
145
  type: :development
145
- prerelease: false
146
- requirement: *id008
146
+ version_requirements: *id008
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: excon
149
- version_requirements: &id009 !ruby/object:Gem::Requirement
149
+ prerelease: false
150
+ requirement: &id009 !ruby/object:Gem::Requirement
150
151
  none: false
151
152
  requirements:
152
153
  - - ">="
@@ -158,11 +159,11 @@ dependencies:
158
159
  - 0
159
160
  version: 0.11.0
160
161
  type: :development
161
- prerelease: false
162
- requirement: *id009
162
+ version_requirements: *id009
163
163
  - !ruby/object:Gem::Dependency
164
164
  name: minitest
165
- version_requirements: &id010 !ruby/object:Gem::Requirement
165
+ prerelease: false
166
+ requirement: &id010 !ruby/object:Gem::Requirement
166
167
  none: false
167
168
  requirements:
168
169
  - - ">="
@@ -174,11 +175,11 @@ dependencies:
174
175
  - 2
175
176
  version: 2.2.2
176
177
  type: :development
177
- prerelease: false
178
- requirement: *id010
178
+ version_requirements: *id010
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: rdoc
181
- version_requirements: &id011 !ruby/object:Gem::Requirement
181
+ prerelease: false
182
+ requirement: &id011 !ruby/object:Gem::Requirement
182
183
  none: false
183
184
  requirements:
184
185
  - - ">"
@@ -190,8 +191,7 @@ dependencies:
190
191
  - 0
191
192
  version: 3.5.0
192
193
  type: :development
193
- prerelease: false
194
- requirement: *id011
194
+ version_requirements: *id011
195
195
  description: WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.
196
196
  email:
197
197
  - bartosz.blimke@gmail.com