mocktopus 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mocktopus/cli.rb +2 -8
- data/lib/mocktopus/input.rb +3 -2
- data/lib/mocktopus/input_container.rb +2 -1
- data/mocktopus.gemspec +2 -2
- 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: 11ec3b399dd8e0d153c4329b0391620d0c24d6f9
|
4
|
+
data.tar.gz: ff552697227fb4933a3960c01881297563d78519
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c03d2ea29fe2f2105b22db27478561867d4a5cbb6910990fd4446ea3417c7365aa5d2e50478dc7f1ff5089f5329d01e6cb9bde1f0efc4e07dd99fd8aace90a1a
|
7
|
+
data.tar.gz: a9ad5adaef8070c71de1ba0e0b316dad2bc30a5b9f26e8d0a751da0e188c7944fafb2bf2a28d1acd9e1972dea6534dc1b197e1314649e8fe45e5fd2f392a6329
|
data/lib/mocktopus/cli.rb
CHANGED
@@ -10,22 +10,16 @@ module Mocktopus
|
|
10
10
|
port_option = args.include?('-p') ? '' : ' -p 8081'
|
11
11
|
args = args.join(' ')
|
12
12
|
command = "bundle exec thin -R #{ENV['CONFIG_RU'] || 'config.ru'} start#{port_option} #{args}"
|
13
|
-
|
13
|
+
Kernel.system(command)
|
14
14
|
end
|
15
15
|
|
16
16
|
desc "stop", "stops the mocktopus"
|
17
17
|
def stop
|
18
18
|
command = "bundle exec thin stop"
|
19
|
-
|
19
|
+
Kernel.system(command)
|
20
20
|
end
|
21
21
|
|
22
22
|
map 's' => :start
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def run_command(command)
|
27
|
-
system(command)
|
28
|
-
end
|
29
23
|
|
30
24
|
end
|
31
25
|
end
|
data/lib/mocktopus/input.rb
CHANGED
@@ -18,7 +18,8 @@ module Mocktopus
|
|
18
18
|
:body,
|
19
19
|
:url_parameters,
|
20
20
|
:verb,
|
21
|
-
:response
|
21
|
+
:response,
|
22
|
+
:skip_body
|
22
23
|
|
23
24
|
def initialize(hash, response)
|
24
25
|
|
@@ -46,7 +47,7 @@ module Mocktopus
|
|
46
47
|
@body = body
|
47
48
|
@verb = hash['verb'].upcase
|
48
49
|
@response = response
|
49
|
-
|
50
|
+
@skip_body = (hash['skip_body'] || false).eql? true
|
50
51
|
validate_instance_variables
|
51
52
|
|
52
53
|
$logger.debug("initialized input object from hash #{hash.inspect()}")
|
@@ -41,7 +41,7 @@ module Mocktopus
|
|
41
41
|
result = nil
|
42
42
|
matches = inputs.select{|v| URI.decode(v.uri).eql?(URI.decode(path)) &&
|
43
43
|
headers_match?(headers, v.headers) &&
|
44
|
-
bodies_match?(v.body, body) &&
|
44
|
+
(v.skip_body || bodies_match?(v.body, body)) &&
|
45
45
|
v.verb.eql?(verb) &&
|
46
46
|
v.url_parameters.eql?(url_parameters) }
|
47
47
|
case matches.size
|
@@ -56,6 +56,7 @@ module Mocktopus
|
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
59
|
+
|
59
60
|
def headers_match?(input_headers, match_headers)
|
60
61
|
match = true
|
61
62
|
if (match_headers != nil)
|
data/mocktopus.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mocktopus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rackspace
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|