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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71610d79cf64f6347948403c03dbe8bde77d0add
4
- data.tar.gz: 89da382ee09231dcd46fc0b6080b7bafeeda91f6
3
+ metadata.gz: 850c08697fd20442edc6b872f01293106b1acd68
4
+ data.tar.gz: 23bb8ea26132554175a221b74bd357f71a523441
5
5
  SHA512:
6
- metadata.gz: f0c7c9d4fe986a2b2bbd187ec1870f71ecadd43d66fa70644f8187bc7dc1b34ff4ffde1c90b83aa867badb472271f5753a4259abf5c37e8a6f32081136ee0951
7
- data.tar.gz: 290cc44db28b220dbf8cf16db772a41002c85d34129b422e09054873717785c2759ab3e02d8737e610ada1c26872f68bfe151fe7a070b19e2d13f01c2e29f339
6
+ metadata.gz: da337069dc06329fb6cb87ce276d883b7bada2c00a678006cad31921bda793f28cd3ce91fa9ef593fd6af447967678256f28e367dfa9279aec7d9ae90a506146
7
+ data.tar.gz: bc398d3e781b0b5530cbe5942c5c396c0f42ffd3a3949d1822370349905c09e1cfc1b278e6f5eaa78b4d24caefcada526d6404bd5b836eee56603434cc1a16d3
@@ -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
- begin
190
- puts RestClient.get("http://localhost:#{@port}/_vanilli/dump")
191
- rescue => e
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
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "vanilli-ruby"
7
- spec.version = "1.1.3"
7
+ spec.version = "1.2.0"
8
8
  spec.authors = ["Alistair Dutton"]
9
9
  spec.email = ["kelveden@gmail.com"]
10
10
 
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.1.3
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-06-19 00:00:00.000000000 Z
11
+ date: 2015-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler