mirage 2.0.14 → 2.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +1 -0
- data/VERSION +1 -1
- data/bin/mirage +1 -1
- data/features/client/put.feature +0 -21
- data/lib/mirage/client.rb +7 -1
- data/mirage.gemspec +2 -2
- data/test.rb +1 -2
- metadata +27 -27
data/HISTORY
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.15
|
data/bin/mirage
CHANGED
@@ -17,7 +17,7 @@ def start_mirage(args)
|
|
17
17
|
puts "Starting Mirage"
|
18
18
|
|
19
19
|
if windows?
|
20
|
-
command = ["cmd", "/C", "start", "
|
20
|
+
command = ["cmd", "/C", "start", "mirage serverk", RUBY_CMD, "#{File.dirname(__FILE__)}/../mirage_server.rb"]
|
21
21
|
else
|
22
22
|
command = [RUBY_CMD, "#{File.dirname(__FILE__)}/../mirage_server.rb"]
|
23
23
|
end
|
data/features/client/put.feature
CHANGED
@@ -98,27 +98,6 @@ Feature: the Mirage client provides methods for setting responses and loading de
|
|
98
98
|
When I send GET to 'http://localhost:7001/mirage/responses/leaving'
|
99
99
|
Then 'goodbye' should be returned
|
100
100
|
|
101
|
-
Scenario: A file is given to the client with substitution in it
|
102
|
-
Given the file 'response_file' contains:
|
103
|
-
"""
|
104
|
-
Hello ${<firstname>(.*?)</firstname>} ${<surname>(.*?)</surname>}, how are you?
|
105
|
-
"""
|
106
|
-
And I run
|
107
|
-
"""
|
108
|
-
puts Dir.pwd
|
109
|
-
Mirage::Client.new.put('greeting', File.open('scratch/response_file')) do |response|
|
110
|
-
response.method = 'POST'
|
111
|
-
end
|
112
|
-
"""
|
113
|
-
When I send POST to 'http://localhost:7001/mirage/responses/greeting' with request entity
|
114
|
-
"""
|
115
|
-
<grettingRequest>
|
116
|
-
<firstname>Leon</firstname>
|
117
|
-
<surname>Davis</surname>
|
118
|
-
</greetingRequest>
|
119
|
-
"""
|
120
|
-
Then 'Hello Leon Davis, how are you?' should be returned
|
121
|
-
|
122
101
|
Scenario: Priming Mirage when one of the response file has something bad in it
|
123
102
|
Given the file 'responses/default_greetings.rb' contains:
|
124
103
|
"""
|
data/lib/mirage/client.rb
CHANGED
@@ -58,7 +58,13 @@ module Mirage
|
|
58
58
|
headers['X-mirage-pattern'] = response.pattern if response.pattern
|
59
59
|
headers['X-mirage-default'] = 'true' if response.default
|
60
60
|
headers['Content-Type'] = response.content_type || 'text/plain'
|
61
|
-
|
61
|
+
|
62
|
+
if response_value.kind_of?(IO)
|
63
|
+
headers['X-mirage-file'] = 'true'
|
64
|
+
else
|
65
|
+
response_value = response_value.to_s
|
66
|
+
end
|
67
|
+
|
62
68
|
build_response(http_put("#{@url}/templates/#{endpoint}",response_value, headers))
|
63
69
|
end
|
64
70
|
|
data/mirage.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "mirage"
|
8
|
-
s.version = "2.0.
|
8
|
+
s.version = "2.0.15"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Leon Davis"]
|
12
|
-
s.date = "2012-01-
|
12
|
+
s.date = "2012-01-11"
|
13
13
|
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
14
|
s.executables = ["mirage"]
|
15
15
|
s.extra_rdoc_files = [
|
data/test.rb
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
puts 'hello' || raise(Exception)
|
1
|
+
puts File.open('rakefile', 'r').kind_of?(IO)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mirage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-11 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
16
|
-
requirement: &
|
16
|
+
requirement: &22484700 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *22484700
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: childprocess
|
27
|
-
requirement: &
|
27
|
+
requirement: &22484000 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *22484000
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: waitforit
|
38
|
-
requirement: &
|
38
|
+
requirement: &22483280 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *22483280
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &22482560 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *22482560
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: cucumber
|
60
|
-
requirement: &
|
60
|
+
requirement: &22481720 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *22481720
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
|
-
requirement: &
|
71
|
+
requirement: &22480980 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *22480980
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: jeweler
|
82
|
-
requirement: &
|
82
|
+
requirement: &22480380 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *22480380
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: sinatra-contrib
|
93
|
-
requirement: &
|
93
|
+
requirement: &22479740 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *22479740
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: mechanize
|
104
|
-
requirement: &
|
104
|
+
requirement: &22479100 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *22479100
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: gemcutter
|
115
|
-
requirement: &
|
115
|
+
requirement: &22478440 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *22478440
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: nokogiri
|
126
|
-
requirement: &
|
126
|
+
requirement: &22477880 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *22477880
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: jruby-openssl
|
137
|
-
requirement: &
|
137
|
+
requirement: &22477380 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,7 +142,7 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *22477380
|
146
146
|
description: Mirage aids testing of your applications by hosting mock responses so
|
147
147
|
that your applications do not have to talk to real endpoints. Its accessible via
|
148
148
|
HTTP and has a RESTful interface.
|
@@ -211,7 +211,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
211
211
|
version: '0'
|
212
212
|
segments:
|
213
213
|
- 0
|
214
|
-
hash: -
|
214
|
+
hash: -744082897949017366
|
215
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
216
216
|
none: false
|
217
217
|
requirements:
|