mini-apivore 0.1.6 → 0.2.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/mini_apivore/validation.rb +12 -5
- data/lib/mini_apivore/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa9fdf04929ba14663fa747bff93b33d363fb8889b35f18c65670a4b71853aa7
|
4
|
+
data.tar.gz: 81b2366fe6a464587cc3c1f0fe35253d03a2e2a44fd08ec0577d36a44b5a9a15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c663d6d801e464d191e78dc86490239aa05a17f54975267f638e5125a02200f89f3661877b3a12482a3df2cad62ea2640c70a2cd1b7e077e76bc34eda68524b
|
7
|
+
data.tar.gz: a396ac9835b5f7432c83c8e38f545b01ff6b51ec8114b979c1af02c4493a64edff01d6488588570b77246cb2afb857caf859c82a0936eb744795ee8325c6820c
|
@@ -21,13 +21,20 @@ module MiniApivore
|
|
21
21
|
def check_route( verb, path, expected_response_code, params = {} )
|
22
22
|
prepare_action_env( verb, path, expected_response_code, params )
|
23
23
|
assert( match?, <<FAIL )
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
Failed at: #{prepare_error_backtrace}\n
|
25
|
+
Failure message: #{failure_message},\n
|
26
|
+
fullpath: #{full_path}, \n
|
27
|
+
params causing failure:#{params}
|
28
28
|
FAIL
|
29
29
|
end
|
30
30
|
|
31
|
+
def prepare_error_backtrace
|
32
|
+
# it will deliver something like this:
|
33
|
+
#"/app/test/helpers/base_routes_helpers.rb:57:in `__create_card'",
|
34
|
+
#"/app/test/integration/cards_api_test.rb:71:in `block (2 levels) in <class:CommentsApiTest>'",
|
35
|
+
Thread.current.backtrace[2..-1].slice_after{|trc| trc[/check_route/] }.to_a.last[0..1]
|
36
|
+
end
|
37
|
+
|
31
38
|
def match?
|
32
39
|
#pre_checks
|
33
40
|
check_request_path
|
@@ -87,7 +94,7 @@ FAIL
|
|
87
94
|
key = param.first
|
88
95
|
dkey = data && ( data[key] || data[key.to_sym] )
|
89
96
|
if dkey
|
90
|
-
path = path.gsub "{#{key}}", dkey.to_param
|
97
|
+
path = path.gsub "{#{key}}", dkey.to_param.to_s
|
91
98
|
else
|
92
99
|
raise URI::InvalidURIError, "No substitution data found for {#{key}}"\
|
93
100
|
" to test the path #{path}.", caller
|
data/lib/mini_apivore/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini-apivore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alekseyl
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|
@@ -104,7 +104,7 @@ licenses:
|
|
104
104
|
- MIT
|
105
105
|
metadata:
|
106
106
|
allowed_push_host: https://rubygems.org
|
107
|
-
post_install_message:
|
107
|
+
post_install_message:
|
108
108
|
rdoc_options: []
|
109
109
|
require_paths:
|
110
110
|
- lib
|
@@ -120,9 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
124
|
-
|
125
|
-
signing_key:
|
123
|
+
rubygems_version: 3.2.15
|
124
|
+
signing_key:
|
126
125
|
specification_version: 4
|
127
126
|
summary: Minitest adaptation of an apivore gem
|
128
127
|
test_files: []
|