mirage 0.1.7 → 1.0.0
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.
- data/features/{clearing_requests_and_responses.feature → clear.feature} +0 -0
- data/features/client/{clearing_responses.feature → clear.feature} +0 -0
- data/features/client/{getting_responses.feature → get.feature} +2 -2
- data/features/client/{peeking.feature → peek.feature} +0 -0
- data/features/client/{snapshotting.feature → save_and_revert.feature} +0 -0
- data/features/client/{setting_responses.feature → set.feature} +0 -0
- data/features/client/{checking_for_requests.feature → track.feature} +1 -1
- data/features/{peeking_at_response.feature → peek.feature} +0 -0
- data/features/{priming.feature → prime.feature} +0 -0
- data/features/{save.feature → save_and_revert.feature} +0 -0
- data/features/{setting_responses.feature → set.feature} +0 -0
- data/features/{default_responses.feature → set_default_response.feature} +0 -0
- data/features/{setting_responses_with_a_delay.feature → set_with_a_delay.feature} +2 -2
- data/features/{setting_responses_with_pattern_matching.feature → set_with_a_pattern.feature} +0 -0
- data/features/{checking_for_requests.feature → track.feature} +6 -6
- data/lib/mirage.rb +1 -0
- data/lib/mirage/client.rb +3 -3
- data/lib/mirage/core.rb +1 -1
- data/lib/view/mirage/index.xhtml +1 -1
- data/mirage.gemspec +1 -1
- metadata +83 -40
File without changes
|
File without changes
|
@@ -22,7 +22,7 @@ Feature: the Mirage client provides a method for getting responses
|
|
22
22
|
"""
|
23
23
|
Mirage::Client.new.get('greeting', :firstname => 'leon', :surname => 'davis').should == 'hello'
|
24
24
|
"""
|
25
|
-
And I hit 'http://localhost:7001/mirage/
|
25
|
+
And I hit 'http://localhost:7001/mirage/track/1'
|
26
26
|
Then 'firstname=leon&surname=davis' should be returned
|
27
27
|
|
28
28
|
Scenario: getting a response with a request body
|
@@ -30,7 +30,7 @@ Feature: the Mirage client provides a method for getting responses
|
|
30
30
|
"""
|
31
31
|
Mirage::Client.new.get('greeting','<greetingRequest></greetingRequest>').should == 'hello'
|
32
32
|
"""
|
33
|
-
And I hit 'http://localhost:7001/mirage/
|
33
|
+
And I hit 'http://localhost:7001/mirage/track/1'
|
34
34
|
Then '<greetingRequest></greetingRequest>' should be returned
|
35
35
|
|
36
36
|
Scenario: getting a response that does not exist
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,7 +4,7 @@ Feature: Its possible introduce a delay before responding to a client with a par
|
|
4
4
|
Scenario: Response with a delay
|
5
5
|
Given I hit 'http://localhost:7001/mirage/set/an_appology' with parameters:
|
6
6
|
| response | Sorry it took me so long! |
|
7
|
-
| delay | 4 |
|
7
|
+
| delay | 4.2 |
|
8
8
|
|
9
9
|
When I hit 'http://localhost:7001/mirage/get/an_appology'
|
10
|
-
Then it should take at least '4' seconds
|
10
|
+
Then it should take at least '4.2' seconds
|
data/features/{setting_responses_with_pattern_matching.feature → set_with_a_pattern.feature}
RENAMED
File without changes
|
@@ -21,7 +21,7 @@ Feature: After a response has been served from Mirage, the content of the reques
|
|
21
21
|
"""
|
22
22
|
Hello MockServer
|
23
23
|
"""
|
24
|
-
When I hit 'http://localhost:7001/mirage/
|
24
|
+
When I hit 'http://localhost:7001/mirage/track/1'
|
25
25
|
Then 'Hello MockServer' should be returned
|
26
26
|
|
27
27
|
|
@@ -29,12 +29,12 @@ Feature: After a response has been served from Mirage, the content of the reques
|
|
29
29
|
Given I hit 'http://localhost:7001/mirage/get/greeting' with parameters:
|
30
30
|
| surname | Davis |
|
31
31
|
| firstname | Leon |
|
32
|
-
When I hit 'http://localhost:7001/mirage/
|
32
|
+
When I hit 'http://localhost:7001/mirage/track/1'
|
33
33
|
Then 'surname=Davis&firstname=Leon' should be returned
|
34
34
|
|
35
35
|
|
36
36
|
Scenario: Querying a response that has not been served yet
|
37
|
-
Given I hit 'http://localhost:7001/mirage/
|
37
|
+
Given I hit 'http://localhost:7001/mirage/track/1'
|
38
38
|
Then a 404 should be returned
|
39
39
|
|
40
40
|
|
@@ -44,7 +44,7 @@ Feature: After a response has been served from Mirage, the content of the reques
|
|
44
44
|
Hello
|
45
45
|
"""
|
46
46
|
And I hit 'http://localhost:7001/mirage/peek/1'
|
47
|
-
When I hit 'http://localhost:7001/mirage/
|
47
|
+
When I hit 'http://localhost:7001/mirage/track/1'
|
48
48
|
Then 'Hello' should be returned
|
49
49
|
|
50
50
|
|
@@ -66,9 +66,9 @@ Feature: After a response has been served from Mirage, the content of the reques
|
|
66
66
|
"""
|
67
67
|
My name is Leon
|
68
68
|
"""
|
69
|
-
And I hit 'http://localhost:7001/mirage/
|
69
|
+
And I hit 'http://localhost:7001/mirage/track/1'
|
70
70
|
Then 'My name is Joel' should be returned
|
71
|
-
And I hit 'http://localhost:7001/mirage/
|
71
|
+
And I hit 'http://localhost:7001/mirage/track/3'
|
72
72
|
Then 'My name is Leon' should be returned
|
73
73
|
|
74
74
|
|
data/lib/mirage.rb
CHANGED
data/lib/mirage/client.rb
CHANGED
@@ -95,9 +95,9 @@ module Mirage
|
|
95
95
|
# request did not have any content in its body then what ever was in the request query string is returned instead
|
96
96
|
#
|
97
97
|
# Example:
|
98
|
-
# Client.new.
|
99
|
-
def
|
100
|
-
response(http_get("#{@url}/
|
98
|
+
# Client.new.track(response_id) => Tracked request as a String
|
99
|
+
def track response_id
|
100
|
+
response(http_get("#{@url}/track/#{response_id}"))
|
101
101
|
end
|
102
102
|
|
103
103
|
# Save the state of the Mirage server so that it can be reverted back to that exact state at a later time.
|
data/lib/mirage/core.rb
CHANGED
data/lib/view/mirage/index.xhtml
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
<?r unless @responses.empty? ?>
|
16
16
|
<table border="1" width='100%'>
|
17
17
|
<?r @responses.each do |key, response| ?>
|
18
|
-
<tr><td><a id='peek_response_#{response.response_id}' href="/mirage/peek/#{response.response_id}">#{key}</a></td><td><a id='check_response_#{response.response_id}' href="/mirage/
|
18
|
+
<tr><td><a id='peek_response_#{response.response_id}' href="/mirage/peek/#{response.response_id}">#{key}</a></td><td><a id='check_response_#{response.response_id}' href="/mirage/track/#{response.response_id}">check</a></td></tr>
|
19
19
|
<?r end ?>
|
20
20
|
</table>
|
21
21
|
<?r end ?>
|
data/mirage.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'mirage'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '1.0.0'
|
4
4
|
s.authors = ["Leon Davis"]
|
5
5
|
s.homepage = 'https://github.com/lashd/mirage'
|
6
6
|
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.'
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mirage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Leon Davis
|
@@ -10,7 +15,7 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-29 00:00:00 +01:00
|
14
19
|
default_executable: mirage
|
15
20
|
dependencies:
|
16
21
|
- !ruby/object:Gem::Dependency
|
@@ -21,6 +26,11 @@ dependencies:
|
|
21
26
|
requirements:
|
22
27
|
- - ~>
|
23
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 19
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 1
|
33
|
+
- 0
|
24
34
|
version: 1.1.0
|
25
35
|
type: :runtime
|
26
36
|
version_requirements: *id001
|
@@ -32,6 +42,11 @@ dependencies:
|
|
32
42
|
requirements:
|
33
43
|
- - ">="
|
34
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 16127
|
46
|
+
segments:
|
47
|
+
- 2011
|
48
|
+
- 1
|
49
|
+
- 30
|
35
50
|
version: 2011.01.30
|
36
51
|
type: :runtime
|
37
52
|
version_requirements: *id002
|
@@ -43,6 +58,11 @@ dependencies:
|
|
43
58
|
requirements:
|
44
59
|
- - ">="
|
45
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 23
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 0
|
65
|
+
- 0
|
46
66
|
version: 1.0.0
|
47
67
|
type: :runtime
|
48
68
|
version_requirements: *id003
|
@@ -54,6 +74,9 @@ dependencies:
|
|
54
74
|
requirements:
|
55
75
|
- - ">="
|
56
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 3
|
78
|
+
segments:
|
79
|
+
- 0
|
57
80
|
version: "0"
|
58
81
|
type: :development
|
59
82
|
version_requirements: *id004
|
@@ -65,6 +88,9 @@ dependencies:
|
|
65
88
|
requirements:
|
66
89
|
- - ">="
|
67
90
|
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 0
|
68
94
|
version: "0"
|
69
95
|
type: :development
|
70
96
|
version_requirements: *id005
|
@@ -76,6 +102,9 @@ dependencies:
|
|
76
102
|
requirements:
|
77
103
|
- - ">="
|
78
104
|
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
79
108
|
version: "0"
|
80
109
|
type: :development
|
81
110
|
version_requirements: *id006
|
@@ -87,6 +116,9 @@ dependencies:
|
|
87
116
|
requirements:
|
88
117
|
- - ">="
|
89
118
|
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
90
122
|
version: "0"
|
91
123
|
type: :development
|
92
124
|
version_requirements: *id007
|
@@ -103,29 +135,29 @@ files:
|
|
103
135
|
- Gemfile
|
104
136
|
- README.md
|
105
137
|
- bin/mirage
|
106
|
-
- features/
|
107
|
-
- features/
|
108
|
-
- features/client/
|
109
|
-
- features/client/clearing_responses.feature
|
110
|
-
- features/client/getting_responses.feature
|
138
|
+
- features/clear.feature
|
139
|
+
- features/client/clear.feature
|
140
|
+
- features/client/get.feature
|
111
141
|
- features/client/mirage_client.feature
|
112
|
-
- features/client/
|
113
|
-
- features/client/
|
114
|
-
- features/client/
|
142
|
+
- features/client/peek.feature
|
143
|
+
- features/client/save_and_revert.feature
|
144
|
+
- features/client/set.feature
|
145
|
+
- features/client/track.feature
|
115
146
|
- features/command_line_iterface.feature
|
116
|
-
- features/default_responses.feature
|
117
147
|
- features/file_hosting.feature
|
118
148
|
- features/logging.feature
|
119
|
-
- features/
|
120
|
-
- features/
|
149
|
+
- features/peek.feature
|
150
|
+
- features/prime.feature
|
121
151
|
- features/resources/test.zip
|
122
152
|
- features/response_templates.feature
|
123
|
-
- features/
|
124
|
-
- features/
|
125
|
-
- features/
|
126
|
-
- features/
|
153
|
+
- features/save_and_revert.feature
|
154
|
+
- features/set.feature
|
155
|
+
- features/set_default_response.feature
|
156
|
+
- features/set_with_a_delay.feature
|
157
|
+
- features/set_with_a_pattern.feature
|
127
158
|
- features/step_definitions/my_steps.rb
|
128
159
|
- features/support/env.rb
|
160
|
+
- features/track.feature
|
129
161
|
- features/web_user_interface.feature
|
130
162
|
- full_build.sh
|
131
163
|
- lib/config.ru
|
@@ -142,13 +174,18 @@ has_rdoc: true
|
|
142
174
|
homepage: https://github.com/lashd/mirage
|
143
175
|
licenses: []
|
144
176
|
|
145
|
-
post_install_message:
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
177
|
+
post_install_message: |
|
178
|
+
|
179
|
+
===============================================================================
|
180
|
+
Thanks you for installing mirage-1.0.0.
|
181
|
+
|
182
|
+
Run Mirage with:
|
183
|
+
|
184
|
+
mirage start
|
185
|
+
|
186
|
+
For more information go to: https://github.com/lashd/mirage/wiki
|
187
|
+
===============================================================================
|
188
|
+
|
152
189
|
rdoc_options: []
|
153
190
|
|
154
191
|
require_paths:
|
@@ -158,12 +195,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
195
|
requirements:
|
159
196
|
- - ">="
|
160
197
|
- !ruby/object:Gem::Version
|
198
|
+
hash: 3
|
199
|
+
segments:
|
200
|
+
- 0
|
161
201
|
version: "0"
|
162
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
203
|
none: false
|
164
204
|
requirements:
|
165
205
|
- - ">="
|
166
206
|
- !ruby/object:Gem::Version
|
207
|
+
hash: 3
|
208
|
+
segments:
|
209
|
+
- 0
|
167
210
|
version: "0"
|
168
211
|
requirements: []
|
169
212
|
|
@@ -171,29 +214,29 @@ rubyforge_project:
|
|
171
214
|
rubygems_version: 1.6.1
|
172
215
|
signing_key:
|
173
216
|
specification_version: 3
|
174
|
-
summary: mirage-0.
|
217
|
+
summary: mirage-1.0.0
|
175
218
|
test_files:
|
176
|
-
- features/
|
177
|
-
- features/
|
178
|
-
- features/client/
|
179
|
-
- features/client/clearing_responses.feature
|
180
|
-
- features/client/getting_responses.feature
|
219
|
+
- features/clear.feature
|
220
|
+
- features/client/clear.feature
|
221
|
+
- features/client/get.feature
|
181
222
|
- features/client/mirage_client.feature
|
182
|
-
- features/client/
|
183
|
-
- features/client/
|
184
|
-
- features/client/
|
223
|
+
- features/client/peek.feature
|
224
|
+
- features/client/save_and_revert.feature
|
225
|
+
- features/client/set.feature
|
226
|
+
- features/client/track.feature
|
185
227
|
- features/command_line_iterface.feature
|
186
|
-
- features/default_responses.feature
|
187
228
|
- features/file_hosting.feature
|
188
229
|
- features/logging.feature
|
189
|
-
- features/
|
190
|
-
- features/
|
230
|
+
- features/peek.feature
|
231
|
+
- features/prime.feature
|
191
232
|
- features/resources/test.zip
|
192
233
|
- features/response_templates.feature
|
193
|
-
- features/
|
194
|
-
- features/
|
195
|
-
- features/
|
196
|
-
- features/
|
234
|
+
- features/save_and_revert.feature
|
235
|
+
- features/set.feature
|
236
|
+
- features/set_default_response.feature
|
237
|
+
- features/set_with_a_delay.feature
|
238
|
+
- features/set_with_a_pattern.feature
|
197
239
|
- features/step_definitions/my_steps.rb
|
198
240
|
- features/support/env.rb
|
241
|
+
- features/track.feature
|
199
242
|
- features/web_user_interface.feature
|