mirage 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +8 -2
- data/features/response_templates.feature +6 -4
- data/lib/mirage/core.rb +1 -1
- data/mirage.gemspec +2 -2
- metadata +187 -164
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mirage (0.1.
|
4
|
+
mirage (0.1.4)
|
5
5
|
mechanize (>= 1.0.0)
|
6
6
|
rack (~> 1.1.0)
|
7
7
|
ramaze (>= 2011.01.30)
|
@@ -19,12 +19,16 @@ GEM
|
|
19
19
|
diff-lcs (1.1.2)
|
20
20
|
gherkin (2.3.5)
|
21
21
|
json (>= 1.4.6)
|
22
|
+
gherkin (2.3.5-java)
|
23
|
+
json (>= 1.4.6)
|
22
24
|
innate (2011.01)
|
23
25
|
rack (>= 1.1.0)
|
24
26
|
json (1.5.1)
|
27
|
+
json (1.5.1-java)
|
25
28
|
mechanize (1.0.0)
|
26
29
|
nokogiri (>= 1.2.1)
|
27
|
-
nokogiri (1.4.4)
|
30
|
+
nokogiri (1.4.4-java)
|
31
|
+
weakling (>= 0.0.3)
|
28
32
|
rack (1.1.2)
|
29
33
|
rake (0.8.7)
|
30
34
|
ramaze (2011.01.30)
|
@@ -38,8 +42,10 @@ GEM
|
|
38
42
|
diff-lcs (~> 1.1.2)
|
39
43
|
rspec-mocks (2.5.0)
|
40
44
|
term-ansicolor (1.0.5)
|
45
|
+
weakling (0.0.4-java)
|
41
46
|
|
42
47
|
PLATFORMS
|
48
|
+
java
|
43
49
|
ruby
|
44
50
|
|
45
51
|
DEPENDENCIES
|
@@ -6,17 +6,18 @@ Feature: Parts of a response can be substitued for values found in the request b
|
|
6
6
|
matching group which is what is put in to the response.
|
7
7
|
|
8
8
|
|
9
|
-
Scenario: A response template populated from
|
9
|
+
Scenario: A response template populated from matches found in the request body using a regex
|
10
10
|
Given I hit 'http://localhost:7001/mirage/set/greeting' with parameters:
|
11
|
-
| response | Hello ${<
|
11
|
+
| response | Hello ${<firstname>(.*?)</firstname>} ${<surname>(.*?)</surname>}, how are you? |
|
12
12
|
|
13
13
|
When I hit 'http://localhost:7001/mirage/get/greeting' with request body:
|
14
14
|
"""
|
15
15
|
<grettingRequest>
|
16
|
-
<
|
16
|
+
<firstname>Leon</firstname>
|
17
|
+
<surname>Davis</surname>
|
17
18
|
</greetingRequest>
|
18
19
|
"""
|
19
|
-
Then 'Hello Leon, how are you?' should be returned
|
20
|
+
Then 'Hello Leon Davis, how are you?' should be returned
|
20
21
|
|
21
22
|
|
22
23
|
Scenario: A response template populated from match found in the query string using a request parameter name
|
@@ -27,6 +28,7 @@ Feature: Parts of a response can be substitued for values found in the request b
|
|
27
28
|
| name | Leon |
|
28
29
|
Then 'Hello Leon, how are you?' should be returned
|
29
30
|
|
31
|
+
|
30
32
|
Scenario: Response template populated from match found in the query string using a regex
|
31
33
|
Given I hit 'http://localhost:7001/mirage/set/greeting' with parameters:
|
32
34
|
| response | Hello ${name=([L\|l]eon)}, how are you? |
|
data/lib/mirage/core.rb
CHANGED
@@ -35,7 +35,7 @@ module Mirage
|
|
35
35
|
return @value if file?
|
36
36
|
|
37
37
|
value = @value
|
38
|
-
value.scan(/\$\{(
|
38
|
+
value.scan(/\$\{([^\}]*)\}/).flatten.each do |pattern|
|
39
39
|
|
40
40
|
if (parameter_match = request_parameters[pattern])
|
41
41
|
value = value.gsub("${#{pattern}}", parameter_match)
|
data/mirage.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'mirage'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.4'
|
4
4
|
s.authors = ["Leon Davis"]
|
5
|
-
s.homepage = 'https://github.com/lashd/
|
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.'
|
7
7
|
s.summary = "mirage-#{s.version}"
|
8
8
|
|
metadata
CHANGED
@@ -1,199 +1,222 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mirage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
|
-
- Leon Davis
|
12
|
+
- Leon Davis
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
16
|
|
13
|
-
date: 2011-03-
|
17
|
+
date: 2011-03-25 00:00:00 +00:00
|
14
18
|
default_executable: mirage
|
15
19
|
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rack
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 1
|
30
|
+
- 0
|
31
|
+
version: 1.1.0
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: ramaze
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 2011
|
43
|
+
- 1
|
44
|
+
- 30
|
45
|
+
version: 2011.01.30
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: mechanize
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 1
|
57
|
+
- 0
|
58
|
+
- 0
|
59
|
+
version: 1.0.0
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
version: "0"
|
72
|
+
type: :development
|
73
|
+
version_requirements: *id004
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
name: cucumber
|
76
|
+
prerelease: false
|
77
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
type: :development
|
85
|
+
version_requirements: *id005
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: rspec
|
88
|
+
prerelease: false
|
89
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
96
|
+
type: :development
|
97
|
+
version_requirements: *id006
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: bundler
|
100
|
+
prerelease: false
|
101
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
type: :development
|
109
|
+
version_requirements: *id007
|
93
110
|
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.
|
94
111
|
email:
|
95
112
|
executables:
|
96
|
-
- mirage
|
113
|
+
- mirage
|
97
114
|
extensions: []
|
98
115
|
|
99
116
|
extra_rdoc_files: []
|
100
117
|
|
101
118
|
files:
|
102
|
-
- .rvmrc
|
103
|
-
- Gemfile
|
104
|
-
- Gemfile.lock
|
105
|
-
- README.md
|
106
|
-
- bin/mirage
|
107
|
-
- features/checking_for_requests.feature
|
108
|
-
- features/clearing_requests_and_responses.feature
|
109
|
-
- features/client/checking_for_requests.feature
|
110
|
-
- features/client/clearing_responses.feature
|
111
|
-
- features/client/getting_responses.feature
|
112
|
-
- features/client/mirage_client.feature
|
113
|
-
- features/client/peeking.feature
|
114
|
-
- features/client/setting_responses.feature
|
115
|
-
- features/client/snapshotting.feature
|
116
|
-
- features/command_line_iterface.feature
|
117
|
-
- features/default_responses.feature
|
118
|
-
- features/file_hosting.feature
|
119
|
-
- features/logging.feature
|
120
|
-
- features/peeking_at_response.feature
|
121
|
-
- features/resources/test.zip
|
122
|
-
- features/response_templates.feature
|
123
|
-
- features/root_responses.feature
|
124
|
-
- features/setting_responses.feature
|
125
|
-
- features/setting_responses_with_a_delay.feature
|
126
|
-
- features/setting_responses_with_pattern_matching.feature
|
127
|
-
- features/snapshotting.feature
|
128
|
-
- features/step_definitions/my_steps.rb
|
129
|
-
- features/support/env.rb
|
130
|
-
- features/web_user_interface.feature
|
131
|
-
- full_build.sh
|
132
|
-
- lib/config.ru
|
133
|
-
- lib/mirage.rb
|
134
|
-
- lib/mirage/client.rb
|
135
|
-
- lib/mirage/core.rb
|
136
|
-
- lib/mirage/util.rb
|
137
|
-
- lib/mirage/web.rb
|
138
|
-
- lib/start_mirage.rb
|
139
|
-
- lib/view/mirage/index.xhtml
|
140
|
-
- mirage.gemspec
|
141
|
-
- rakefile
|
119
|
+
- .rvmrc
|
120
|
+
- Gemfile
|
121
|
+
- Gemfile.lock
|
122
|
+
- README.md
|
123
|
+
- bin/mirage
|
124
|
+
- features/checking_for_requests.feature
|
125
|
+
- features/clearing_requests_and_responses.feature
|
126
|
+
- features/client/checking_for_requests.feature
|
127
|
+
- features/client/clearing_responses.feature
|
128
|
+
- features/client/getting_responses.feature
|
129
|
+
- features/client/mirage_client.feature
|
130
|
+
- features/client/peeking.feature
|
131
|
+
- features/client/setting_responses.feature
|
132
|
+
- features/client/snapshotting.feature
|
133
|
+
- features/command_line_iterface.feature
|
134
|
+
- features/default_responses.feature
|
135
|
+
- features/file_hosting.feature
|
136
|
+
- features/logging.feature
|
137
|
+
- features/peeking_at_response.feature
|
138
|
+
- features/resources/test.zip
|
139
|
+
- features/response_templates.feature
|
140
|
+
- features/root_responses.feature
|
141
|
+
- features/setting_responses.feature
|
142
|
+
- features/setting_responses_with_a_delay.feature
|
143
|
+
- features/setting_responses_with_pattern_matching.feature
|
144
|
+
- features/snapshotting.feature
|
145
|
+
- features/step_definitions/my_steps.rb
|
146
|
+
- features/support/env.rb
|
147
|
+
- features/web_user_interface.feature
|
148
|
+
- full_build.sh
|
149
|
+
- lib/config.ru
|
150
|
+
- lib/mirage.rb
|
151
|
+
- lib/mirage/client.rb
|
152
|
+
- lib/mirage/core.rb
|
153
|
+
- lib/mirage/util.rb
|
154
|
+
- lib/mirage/web.rb
|
155
|
+
- lib/start_mirage.rb
|
156
|
+
- lib/view/mirage/index.xhtml
|
157
|
+
- mirage.gemspec
|
158
|
+
- rakefile
|
142
159
|
has_rdoc: true
|
143
|
-
homepage: https://github.com/lashd/
|
160
|
+
homepage: https://github.com/lashd/mirage
|
144
161
|
licenses: []
|
145
162
|
|
146
|
-
post_install_message:
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
163
|
+
post_install_message: |
|
164
|
+
|
165
|
+
===============================================================================
|
166
|
+
Thanks you for installing mirage-0.1.4.
|
167
|
+
|
168
|
+
Run Mirage with:
|
169
|
+
|
170
|
+
mirage start
|
171
|
+
===============================================================================
|
172
|
+
|
152
173
|
rdoc_options: []
|
153
174
|
|
154
175
|
require_paths:
|
155
|
-
- lib
|
176
|
+
- lib
|
156
177
|
required_ruby_version: !ruby/object:Gem::Requirement
|
157
|
-
none: false
|
158
178
|
requirements:
|
159
|
-
|
160
|
-
|
161
|
-
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
segments:
|
182
|
+
- 0
|
183
|
+
version: "0"
|
162
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
-
none: false
|
164
185
|
requirements:
|
165
|
-
|
166
|
-
|
167
|
-
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
segments:
|
189
|
+
- 0
|
190
|
+
version: "0"
|
168
191
|
requirements: []
|
169
192
|
|
170
193
|
rubyforge_project:
|
171
|
-
rubygems_version: 1.6
|
194
|
+
rubygems_version: 1.3.6
|
172
195
|
signing_key:
|
173
196
|
specification_version: 3
|
174
|
-
summary: mirage-0.1.
|
197
|
+
summary: mirage-0.1.4
|
175
198
|
test_files:
|
176
|
-
- features/checking_for_requests.feature
|
177
|
-
- features/clearing_requests_and_responses.feature
|
178
|
-
- features/client/checking_for_requests.feature
|
179
|
-
- features/client/clearing_responses.feature
|
180
|
-
- features/client/getting_responses.feature
|
181
|
-
- features/client/mirage_client.feature
|
182
|
-
- features/client/peeking.feature
|
183
|
-
- features/client/setting_responses.feature
|
184
|
-
- features/client/snapshotting.feature
|
185
|
-
- features/command_line_iterface.feature
|
186
|
-
- features/default_responses.feature
|
187
|
-
- features/file_hosting.feature
|
188
|
-
- features/logging.feature
|
189
|
-
- features/peeking_at_response.feature
|
190
|
-
- features/resources/test.zip
|
191
|
-
- features/response_templates.feature
|
192
|
-
- features/root_responses.feature
|
193
|
-
- features/setting_responses.feature
|
194
|
-
- features/setting_responses_with_a_delay.feature
|
195
|
-
- features/setting_responses_with_pattern_matching.feature
|
196
|
-
- features/snapshotting.feature
|
197
|
-
- features/step_definitions/my_steps.rb
|
198
|
-
- features/support/env.rb
|
199
|
-
- features/web_user_interface.feature
|
199
|
+
- features/checking_for_requests.feature
|
200
|
+
- features/clearing_requests_and_responses.feature
|
201
|
+
- features/client/checking_for_requests.feature
|
202
|
+
- features/client/clearing_responses.feature
|
203
|
+
- features/client/getting_responses.feature
|
204
|
+
- features/client/mirage_client.feature
|
205
|
+
- features/client/peeking.feature
|
206
|
+
- features/client/setting_responses.feature
|
207
|
+
- features/client/snapshotting.feature
|
208
|
+
- features/command_line_iterface.feature
|
209
|
+
- features/default_responses.feature
|
210
|
+
- features/file_hosting.feature
|
211
|
+
- features/logging.feature
|
212
|
+
- features/peeking_at_response.feature
|
213
|
+
- features/resources/test.zip
|
214
|
+
- features/response_templates.feature
|
215
|
+
- features/root_responses.feature
|
216
|
+
- features/setting_responses.feature
|
217
|
+
- features/setting_responses_with_a_delay.feature
|
218
|
+
- features/setting_responses_with_pattern_matching.feature
|
219
|
+
- features/snapshotting.feature
|
220
|
+
- features/step_definitions/my_steps.rb
|
221
|
+
- features/support/env.rb
|
222
|
+
- features/web_user_interface.feature
|