vanilli-ruby 1.1.3 → 1.2.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.
- checksums.yaml +4 -4
- data/lib/vanilli/client.rb +11 -8
- data/vanilli-ruby.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 850c08697fd20442edc6b872f01293106b1acd68
|
4
|
+
data.tar.gz: 23bb8ea26132554175a221b74bd357f71a523441
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da337069dc06329fb6cb87ce276d883b7bada2c00a678006cad31921bda793f28cd3ce91fa9ef593fd6af447967678256f28e367dfa9279aec7d9ae90a506146
|
7
|
+
data.tar.gz: bc398d3e781b0b5530cbe5942c5c396c0f42ffd3a3949d1822370349905c09e1cfc1b278e6f5eaa78b4d24caefcada526d6404bd5b836eee56603434cc1a16d3
|
data/lib/vanilli/client.rb
CHANGED
@@ -42,7 +42,7 @@ class VanilliClient
|
|
42
42
|
def initialize(port)
|
43
43
|
@port = port
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
# Represents a single stub as will be registered with
|
47
47
|
# the vanilli server.
|
48
48
|
class Stub
|
@@ -62,7 +62,7 @@ class VanilliClient
|
|
62
62
|
contentType: content_type,
|
63
63
|
body: body,
|
64
64
|
headers: headers))
|
65
|
-
@times = times
|
65
|
+
@times = times unless times == :any
|
66
66
|
|
67
67
|
self
|
68
68
|
end
|
@@ -90,6 +90,10 @@ class VanilliClient
|
|
90
90
|
captureId: @capture_id,
|
91
91
|
expect: @expect).to_json
|
92
92
|
end
|
93
|
+
|
94
|
+
def ensure_times_exists
|
95
|
+
@expect = 1 unless @expect
|
96
|
+
end
|
93
97
|
end
|
94
98
|
|
95
99
|
# Create a new Stub that will be matched
|
@@ -146,6 +150,8 @@ class VanilliClient
|
|
146
150
|
# vanilli server.
|
147
151
|
def expect(expectation)
|
148
152
|
expectation.expect = true
|
153
|
+
expectation.ensure_times_exists
|
154
|
+
|
149
155
|
stub(expectation)
|
150
156
|
end
|
151
157
|
|
@@ -182,14 +188,11 @@ class VanilliClient
|
|
182
188
|
get_captures(capture_id).last
|
183
189
|
end
|
184
190
|
|
185
|
-
|
186
191
|
# Verifies that all vanilli expectations have been met. If
|
187
192
|
# not, an error is thrown.
|
188
193
|
def dump
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
raise e.response
|
193
|
-
end
|
194
|
+
puts RestClient.get("http://localhost:#{@port}/_vanilli/dump")
|
195
|
+
rescue => e
|
196
|
+
raise e.response
|
194
197
|
end
|
195
198
|
end
|
data/vanilli-ruby.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vanilli-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alistair Dutton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|