vanilli-ruby 1.1.0 → 1.1.1
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 +9 -5
- 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: 41c6d1fd4c2a3d2a7a556bae0b93fa2cf4c5a087
|
4
|
+
data.tar.gz: 3fb2c7bc730c90aa8a60edf5fcb2a16bd7db3970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814f9a000b5b98dd1b8166fd6545d808a94cd3fef2e9f44b5aea3311f2ef1b136bd0a74a1c57102641349ecb00b2783139db0ce32091f7fab17910ac9f208bde
|
7
|
+
data.tar.gz: 8c8ea29fb01b774479d1795dc978840bdac02f74aba8770f05b1b159365d2b7d4571dbe80ec2e39b6f47f4ce0c6511417183136248f678e0b558c811ebe89767
|
data/lib/vanilli/client.rb
CHANGED
@@ -39,6 +39,10 @@ end
|
|
39
39
|
# "rubified" (i.e. snake-case for camel-case) version of the
|
40
40
|
# default javascript API provided with vanilli.
|
41
41
|
class VanilliClient
|
42
|
+
def initialize(port)
|
43
|
+
@port = port
|
44
|
+
end
|
45
|
+
|
42
46
|
# Represents a single stub as will be registered with
|
43
47
|
# the vanilli server.
|
44
48
|
class Stub
|
@@ -131,7 +135,7 @@ class VanilliClient
|
|
131
135
|
def stub(*stubs)
|
132
136
|
stubs.each do |stub|
|
133
137
|
begin
|
134
|
-
RestClient.post
|
138
|
+
RestClient.post "http://localhost:#{@port}/_vanilli/stubs", stub.to_json, content_type: :json, accept: :json
|
135
139
|
rescue => e
|
136
140
|
raise e.response
|
137
141
|
end
|
@@ -147,7 +151,7 @@ class VanilliClient
|
|
147
151
|
|
148
152
|
# Clears the vanilli server of all stubs.
|
149
153
|
def clear
|
150
|
-
RestClient.delete
|
154
|
+
RestClient.delete "http://localhost:#{@port}/_vanilli/stubs"
|
151
155
|
rescue => e
|
152
156
|
raise e.response
|
153
157
|
end
|
@@ -156,7 +160,7 @@ class VanilliClient
|
|
156
160
|
# not, an error is thrown.
|
157
161
|
def verify
|
158
162
|
begin
|
159
|
-
res = JSON.parse(RestClient.get
|
163
|
+
res = JSON.parse(RestClient.get "http://localhost:#{@port}/_vanilli/verify")
|
160
164
|
rescue => e
|
161
165
|
raise e.response
|
162
166
|
end
|
@@ -167,7 +171,7 @@ class VanilliClient
|
|
167
171
|
# Pulls back details of all requests that were logged against the
|
168
172
|
# specified capture id.
|
169
173
|
def get_captures(capture_id)
|
170
|
-
JSON.parse(RestClient.get
|
174
|
+
JSON.parse(RestClient.get "http://localhost:#{@port}/_vanilli/captures/#{capture_id}")
|
171
175
|
rescue => e
|
172
176
|
raise e.response
|
173
177
|
end
|
@@ -183,7 +187,7 @@ class VanilliClient
|
|
183
187
|
# not, an error is thrown.
|
184
188
|
def dump
|
185
189
|
begin
|
186
|
-
puts RestClient.get(
|
190
|
+
puts RestClient.get("http://localhost:#{@port}/_vanilli/dump")
|
187
191
|
rescue => e
|
188
192
|
raise e.response
|
189
193
|
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.1.
|
4
|
+
version: 1.1.1
|
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-
|
11
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|