client-api 0.1.7 → 0.1.8
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/client-api/validator.rb +7 -7
- data/lib/client-api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90f57d4bb7258b9379ce62e5ab5f3b1cc11e4358704bf39bb7ac90218c440e85
|
4
|
+
data.tar.gz: '084385181bfbc9801575f6737e9861ae8dc49ef8d04b38608954a10769d5bf39'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09fee340a3b56630f10b56b8399e47d5e3ff466700ac960168f1dbd36f4852270a50fb84cf756049472f9237585f603f7af3b7c06e377131f34cbe167a80780d'
|
7
|
+
data.tar.gz: d97c961ba0ac05277df209faa700c946d519fdedca923de488672678135b9b51796e98f2292e34f59d7c6e35f1cf4429414d998bb2649f3f5ba7eb3ce7be4fbe
|
data/lib/client-api/validator.rb
CHANGED
@@ -26,7 +26,7 @@ module ClientApi
|
|
26
26
|
|
27
27
|
# datatype validation
|
28
28
|
if (type == "boolean" || type == "bool") && value.nil?
|
29
|
-
expect(%w[TrueClass, FalseClass].any? {|bool| @resp.class.to_s.include? bool}).to
|
29
|
+
expect(%w[TrueClass, FalseClass].any? {|bool| @resp.class.to_s.include? bool}).to eq(true), lambda {"[key]: \"#{data[:key]}\"".blue + "\n didn't match \n[type]: \"#{data[:type]}\"\n"}
|
30
30
|
else
|
31
31
|
expect(datatype(type, value)).to eq(@resp.class), lambda {"[key]: \"#{data[:key]}\"".blue + "\n didn't match \n[type]: \"#{data[:type]}\"\n"}
|
32
32
|
end
|
@@ -37,7 +37,7 @@ module ClientApi
|
|
37
37
|
|
38
38
|
# datatype validation
|
39
39
|
if (type == "boolean" || type == "bool") && value.nil?
|
40
|
-
expect(%w[TrueClass, FalseClass].any? {|bool| @resp.class.to_s.include? bool}).not_to
|
40
|
+
expect(%w[TrueClass, FalseClass].any? {|bool| @resp.class.to_s.include? bool}).not_to eq(true), lambda {"[key]: \"#{data[:key]}\"".blue + "\n didn't match \n[type]: \"#{data[:type]}\"\n"}
|
41
41
|
else
|
42
42
|
expect(datatype(type, value)).not_to eq(@resp.class), lambda {"[key]: \"#{data[:key]}\"".blue + "\n didn't match \n[type]: \"#{data[:type]}\"\n"}
|
43
43
|
end
|
@@ -49,7 +49,7 @@ module ClientApi
|
|
49
49
|
|
50
50
|
def validate_schema(param1, param2)
|
51
51
|
expected_schema = JSON::Validator.validate(param1, param2)
|
52
|
-
expect(expected_schema).to
|
52
|
+
expect(expected_schema).to eq(true)
|
53
53
|
end
|
54
54
|
|
55
55
|
def datatype(type, value)
|
@@ -65,6 +65,10 @@ module ClientApi
|
|
65
65
|
Object
|
66
66
|
elsif (type.downcase == 'boolean') || (type.downcase == 'bool')
|
67
67
|
value === true ? TrueClass : FalseClass
|
68
|
+
elsif (type.downcase == 'falseclass') || (type.downcase == 'false')
|
69
|
+
FalseClass
|
70
|
+
elsif (type.downcase == 'trueclass') || (type.downcase == 'true')
|
71
|
+
TrueClass
|
68
72
|
elsif type.downcase == 'float'
|
69
73
|
Float
|
70
74
|
elsif type.downcase == 'hash'
|
@@ -75,10 +79,6 @@ module ClientApi
|
|
75
79
|
Rational
|
76
80
|
elsif type.downcase == 'fixnum'
|
77
81
|
Fixnum
|
78
|
-
elsif type.downcase == 'falseclass'
|
79
|
-
FalseClass
|
80
|
-
elsif type.downcase == 'trueclass'
|
81
|
-
TrueClass
|
82
82
|
elsif type.downcase == 'bignum'
|
83
83
|
Bignum
|
84
84
|
else
|
data/lib/client-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: client-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prashanth Sams
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,6 +120,6 @@ requirements: []
|
|
120
120
|
rubygems_version: 3.0.4
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
|
-
summary: HTTP Rest Api client for RSpec
|
123
|
+
summary: HTTP Rest Api client for RSpec test automation framework that binds within
|
124
124
|
itself
|
125
125
|
test_files: []
|