mirage 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDU3ZDM3N2QxMDg4MzZjY2EzZDk1NWNhYzc1ZTZlNWU5ZmJlZjk5Mg==
5
+ data.tar.gz: !binary |-
6
+ YzY2OTZjMTJjNDVkMDk3MDA5YmU4YzY4OWExNjUxNWZmOGNlNjIxNw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NzIxMDk3OThkNTgwOGQ0MDhhYThlZjNjNDk0MWI1ZmMxZWNiMjliZTE5M2Yw
10
+ NjI3Y2EzZDI5MmNiNGFhYzFhMDBkODQyMjA0MDRlNmQ1NWZjNDNlMWJkYjg2
11
+ NjgxNjRkYmNjMjM2MzA3Mzg1OTMwMGFlZjQ1Yjk4Yzc1NTZiNTQ=
12
+ data.tar.gz: !binary |-
13
+ MGUzZmQ1OTgyMDIwOTdjNWMwZmVkN2JjYjIyZWEyYTE1YWY2YWFlMDIwMTg5
14
+ NGQwOWE0ZGY4MGIxMDg3YjUyNjZkMTU1ZDgzMDBlMDVkNGFlOWFlMzdiYjdk
15
+ NmFkMzZmNmE5MWViODA4OTY1NWUxN2IxZTE5YTE5NGFmYjU2YmM=
data/Gemfile CHANGED
@@ -20,8 +20,6 @@ group :development do
20
20
  gem 'rake'
21
21
  gem "jeweler"
22
22
  gem 'sinatra-contrib'
23
- gem 'mechanize'
24
- gem "nokogiri"
25
23
 
26
24
  platform :jruby do
27
25
  gem "jruby-openssl"
data/Gemfile.lock CHANGED
@@ -14,8 +14,6 @@ GEM
14
14
  multi_json (>= 1.7.5, < 2.0)
15
15
  multi_test (>= 0.0.2)
16
16
  diff-lcs (1.2.4)
17
- domain_name (0.5.14)
18
- unf (>= 0.0.5, < 1.0.0)
19
17
  faraday (0.8.8)
20
18
  multipart-post (~> 1.2.0)
21
19
  ffi (1.9.0)
@@ -38,8 +36,6 @@ GEM
38
36
  tilt
39
37
  hashie (2.0.5)
40
38
  highline (1.6.20)
41
- http-cookie (1.0.2)
42
- domain_name (~> 0.5)
43
39
  httparty (0.12.0)
44
40
  json (~> 1.8)
45
41
  multi_xml (>= 0.5.2)
@@ -59,26 +55,13 @@ GEM
59
55
  json (1.8.1-java)
60
56
  jwt (0.1.8)
61
57
  multi_json (>= 1.5)
62
- mechanize (2.7.2)
63
- domain_name (~> 0.5, >= 0.5.1)
64
- http-cookie (~> 1.0.0)
65
- mime-types (~> 1.17, >= 1.17.2)
66
- net-http-digest_auth (~> 1.1, >= 1.1.1)
67
- net-http-persistent (~> 2.5, >= 2.5.2)
68
- nokogiri (~> 1.4)
69
- ntlm-http (~> 0.1, >= 0.1.1)
70
- webrobots (>= 0.0.9, < 0.2)
71
- mime-types (1.25)
72
58
  multi_json (1.8.2)
73
59
  multi_test (0.0.2)
74
60
  multi_xml (0.5.5)
75
61
  multipart-post (1.2.0)
76
- net-http-digest_auth (1.4)
77
- net-http-persistent (2.9)
78
62
  nokogiri (1.5.10)
79
63
  nokogiri (1.5.10-java)
80
64
  nokogiri (1.5.10-x86-mingw32)
81
- ntlm-http (0.1.1)
82
65
  oauth2 (0.9.2)
83
66
  faraday (~> 0.8)
84
67
  httpauth (~> 0.2)
@@ -122,13 +105,7 @@ GEM
122
105
  tilt (~> 1.3)
123
106
  thor (0.18.1)
124
107
  tilt (1.4.1)
125
- unf (0.1.3)
126
- unf_ext
127
- unf (0.1.3-java)
128
- unf_ext (0.0.6)
129
- unf_ext (0.0.6-x86-mingw32)
130
108
  waitforit (0.0.1)
131
- webrobots (0.1.1)
132
109
  win32-api (1.5.0-x86-mingw32)
133
110
  win32-file (0.6.8)
134
111
  win32-api (>= 1.2.1)
@@ -155,8 +132,6 @@ DEPENDENCIES
155
132
  httparty
156
133
  jeweler
157
134
  jruby-openssl
158
- mechanize
159
- nokogiri
160
135
  ptools
161
136
  rack-test
162
137
  rake
data/HISTORY CHANGED
@@ -1,3 +1,4 @@
1
+ V3.0.5 - fixed bug in builder methods
1
2
  V3.0.1 - updating gem post install message to point people towards the readme due checkout the differences between version 2 and 3 of Mirage
2
3
  V3.0.0 - Major update see README.md
3
4
  V2.4.2 - update eventmachine, make sure Mirage.start always returns a client
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.5
1
+ 3.0.6
@@ -68,6 +68,7 @@ Then /^request data should have been retrieved$/ do
68
68
  request_data.include?('headers').should == true
69
69
  request_data.include?('body').should == true
70
70
  request_data.include?('request_url').should == true
71
+ request_data.include?('id').should == true
71
72
  end
72
73
 
73
74
  Then(/^the template (request|response) specification should have the following set:$/) do |spec, table|
@@ -12,14 +12,15 @@ module Mirage
12
12
  request.headers = result.headers
13
13
  request.request_url = result.request_url
14
14
  request.body = result.body
15
+ request.id = result.id
15
16
  request
16
17
  end
17
18
  end
18
19
 
19
- attr_accessor :parameters, :headers, :body, :request_url
20
+ attr_accessor :parameters, :headers, :body, :request_url, :id
20
21
 
21
22
  def delete
22
- self.class.delete(request_url)
23
+ self.class.delete(id)
23
24
  end
24
25
  end
25
26
  end
data/mirage.gemspec CHANGED
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: mirage 3.0.6 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "mirage"
8
- s.version = "3.0.5"
9
+ s.version = "3.0.6"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Leon Davis"]
12
- s.date = "2014-01-19"
14
+ s.date = "2014-01-23"
13
15
  s.description = "Mirage aids testing of your applications by hosting mock responses so that your applications do not have to talk to real endpoints. Its accessible via HTTP and has a RESTful interface."
14
16
  s.executables = ["mirage"]
15
17
  s.extra_rdoc_files = [
@@ -116,13 +118,12 @@ Gem::Specification.new do |s|
116
118
  ]
117
119
  s.homepage = "https://github.com/lashd/mirage"
118
120
  s.licenses = ["MIT"]
119
- s.post_install_message = "\n===============================================================================\nMirage v3:\n\nMirage has just gone up a major version from 2 to 3. If you're project uses\na previous version take a look at https://github.com/lashd/mirage to see\nwhat's changed\n===============================================================================\n"
120
- s.require_paths = ["lib"]
121
- s.rubygems_version = "1.8.25"
121
+ s.post_install_message = "\n===============================================================================\nMirage v3:\n\nMirage has just gone up a major version from 2 to 3. If your project uses\na previous version take a look at https://github.com/lashd/mirage to see\nwhat's changed\n===============================================================================\n"
122
+ s.rubygems_version = "2.2.0"
122
123
  s.summary = "Mirage is a easy mock server for testing your applications"
123
124
 
124
125
  if s.respond_to? :specification_version then
125
- s.specification_version = 3
126
+ s.specification_version = 4
126
127
 
127
128
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
128
129
  s.add_runtime_dependency(%q<sinatra>, [">= 0"])
@@ -136,8 +137,6 @@ Gem::Specification.new do |s|
136
137
  s.add_development_dependency(%q<rake>, [">= 0"])
137
138
  s.add_development_dependency(%q<jeweler>, [">= 0"])
138
139
  s.add_development_dependency(%q<sinatra-contrib>, [">= 0"])
139
- s.add_development_dependency(%q<mechanize>, [">= 0"])
140
- s.add_development_dependency(%q<nokogiri>, [">= 0"])
141
140
  s.add_development_dependency(%q<jruby-openssl>, [">= 0"])
142
141
  else
143
142
  s.add_dependency(%q<sinatra>, [">= 0"])
@@ -151,8 +150,6 @@ Gem::Specification.new do |s|
151
150
  s.add_dependency(%q<rake>, [">= 0"])
152
151
  s.add_dependency(%q<jeweler>, [">= 0"])
153
152
  s.add_dependency(%q<sinatra-contrib>, [">= 0"])
154
- s.add_dependency(%q<mechanize>, [">= 0"])
155
- s.add_dependency(%q<nokogiri>, [">= 0"])
156
153
  s.add_dependency(%q<jruby-openssl>, [">= 0"])
157
154
  end
158
155
  else
@@ -167,8 +164,6 @@ Gem::Specification.new do |s|
167
164
  s.add_dependency(%q<rake>, [">= 0"])
168
165
  s.add_dependency(%q<jeweler>, [">= 0"])
169
166
  s.add_dependency(%q<sinatra-contrib>, [">= 0"])
170
- s.add_dependency(%q<mechanize>, [">= 0"])
171
- s.add_dependency(%q<nokogiri>, [">= 0"])
172
167
  s.add_dependency(%q<jruby-openssl>, [">= 0"])
173
168
  end
174
169
  end
data/server/server.rb CHANGED
@@ -95,7 +95,8 @@ module Mirage
95
95
 
96
96
  parameters = tracked_request.params.dup.select { |key, value| key != body }
97
97
 
98
- {request_url: request.url,
98
+ {id: request.url,
99
+ request_url: tracked_request.url,
99
100
  headers: extract_http_headers(tracked_request.env),
100
101
  parameters: parameters,
101
102
  body: body}.to_json
@@ -1,7 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Request do
4
- let(:request_url) { "url" }
4
+ let(:id) { "url_for_request_entity" }
5
+ let(:request_url) { "requested_url" }
5
6
  let(:trigger_url) { "trigger url" }
6
7
 
7
8
  let(:body) { "body" }
@@ -12,14 +13,15 @@ describe Request do
12
13
  {body: body,
13
14
  headers: headers,
14
15
  parameters: parameters,
15
- request_url: trigger_url}
16
+ request_url: trigger_url,
17
+ id: id}
16
18
  end
17
19
 
18
20
  it 'delete a request' do
19
- request_url = "url"
20
- Request.should_receive(:delete).with(request_url)
21
+ id = "url"
22
+ Request.should_receive(:delete).with(id)
21
23
  request = Request.new
22
- request.request_url = request_url
24
+ request.id = id
23
25
  request.delete
24
26
  end
25
27
 
@@ -31,6 +33,7 @@ describe Request do
31
33
  request.body.should == body
32
34
  request.request_url.should == trigger_url
33
35
  request.parameters.should == parameters
36
+ request.id.should == id
34
37
  end
35
38
 
36
39
  end
@@ -141,7 +141,8 @@ describe "Mirage Server" do
141
141
  request_data['parameters'].should == {'param' => 'value'}
142
142
  request_data['headers']["MYHEADER"].should == "my_header_value"
143
143
  request_data['body'].should == "body"
144
- request_data['request_url'].should == "http://example.org/requests/#{response_id}"
144
+ request_data['request_url'].should == "http://example.org/responses/greeting?param=value"
145
+ request_data['id'].should == "http://example.org/requests/#{response_id}"
145
146
 
146
147
  end
147
148
 
data/tasks/packaging.rake CHANGED
@@ -19,7 +19,7 @@ Jeweler::Tasks.new do |gem|
19
19
  ===============================================================================
20
20
  Mirage v3:
21
21
 
22
- Mirage has just gone up a major version from 2 to 3. If you're project uses
22
+ Mirage has just gone up a major version from 2 to 3. If your project uses
23
23
  a previous version take a look at https://github.com/lashd/mirage to see
24
24
  what's changed
25
25
  ===============================================================================
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mirage
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
5
- prerelease:
4
+ version: 3.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Leon Davis
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-19 00:00:00.000000000 Z
11
+ date: 2014-01-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sinatra
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: childprocess
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: waitforit
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: thor
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: ptools
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: httparty
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ! '>='
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ! '>='
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: haml
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ! '>='
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ! '>='
124
109
  - !ruby/object:Gem::Version
@@ -126,7 +111,6 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: hashie
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ! '>='
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :runtime
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ! '>='
140
123
  - !ruby/object:Gem::Version
@@ -142,7 +125,6 @@ dependencies:
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: rake
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ! '>='
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ! '>='
156
137
  - !ruby/object:Gem::Version
@@ -158,7 +139,6 @@ dependencies:
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: jeweler
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
143
  - - ! '>='
164
144
  - !ruby/object:Gem::Version
@@ -166,7 +146,6 @@ dependencies:
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
150
  - - ! '>='
172
151
  - !ruby/object:Gem::Version
@@ -174,7 +153,6 @@ dependencies:
174
153
  - !ruby/object:Gem::Dependency
175
154
  name: sinatra-contrib
176
155
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
156
  requirements:
179
157
  - - ! '>='
180
158
  - !ruby/object:Gem::Version
@@ -182,39 +160,6 @@ dependencies:
182
160
  type: :development
183
161
  prerelease: false
184
162
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
- requirements:
187
- - - ! '>='
188
- - !ruby/object:Gem::Version
189
- version: '0'
190
- - !ruby/object:Gem::Dependency
191
- name: mechanize
192
- requirement: !ruby/object:Gem::Requirement
193
- none: false
194
- requirements:
195
- - - ! '>='
196
- - !ruby/object:Gem::Version
197
- version: '0'
198
- type: :development
199
- prerelease: false
200
- version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
- requirements:
203
- - - ! '>='
204
- - !ruby/object:Gem::Version
205
- version: '0'
206
- - !ruby/object:Gem::Dependency
207
- name: nokogiri
208
- requirement: !ruby/object:Gem::Requirement
209
- none: false
210
- requirements:
211
- - - ! '>='
212
- - !ruby/object:Gem::Version
213
- version: '0'
214
- type: :development
215
- prerelease: false
216
- version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
163
  requirements:
219
164
  - - ! '>='
220
165
  - !ruby/object:Gem::Version
@@ -222,7 +167,6 @@ dependencies:
222
167
  - !ruby/object:Gem::Dependency
223
168
  name: jruby-openssl
224
169
  requirement: !ruby/object:Gem::Requirement
225
- none: false
226
170
  requirements:
227
171
  - - ! '>='
228
172
  - !ruby/object:Gem::Version
@@ -230,7 +174,6 @@ dependencies:
230
174
  type: :development
231
175
  prerelease: false
232
176
  version_requirements: !ruby/object:Gem::Requirement
233
- none: false
234
177
  requirements:
235
178
  - - ! '>='
236
179
  - !ruby/object:Gem::Version
@@ -345,6 +288,7 @@ files:
345
288
  homepage: https://github.com/lashd/mirage
346
289
  licenses:
347
290
  - MIT
291
+ metadata: {}
348
292
  post_install_message: ! '
349
293
 
350
294
  ===============================================================================
@@ -352,7 +296,7 @@ post_install_message: ! '
352
296
  Mirage v3:
353
297
 
354
298
 
355
- Mirage has just gone up a major version from 2 to 3. If you''re project uses
299
+ Mirage has just gone up a major version from 2 to 3. If your project uses
356
300
 
357
301
  a previous version take a look at https://github.com/lashd/mirage to see
358
302
 
@@ -365,24 +309,19 @@ rdoc_options: []
365
309
  require_paths:
366
310
  - lib
367
311
  required_ruby_version: !ruby/object:Gem::Requirement
368
- none: false
369
312
  requirements:
370
313
  - - ! '>='
371
314
  - !ruby/object:Gem::Version
372
315
  version: '0'
373
- segments:
374
- - 0
375
- hash: -158737056239506774
376
316
  required_rubygems_version: !ruby/object:Gem::Requirement
377
- none: false
378
317
  requirements:
379
318
  - - ! '>='
380
319
  - !ruby/object:Gem::Version
381
320
  version: '0'
382
321
  requirements: []
383
322
  rubyforge_project:
384
- rubygems_version: 1.8.25
323
+ rubygems_version: 2.2.0
385
324
  signing_key:
386
- specification_version: 3
325
+ specification_version: 4
387
326
  summary: Mirage is a easy mock server for testing your applications
388
327
  test_files: []