inventory-server 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa2af8dd9d05ac5a2cca7365f5fa6c4c7e8bd67e
|
4
|
+
data.tar.gz: 89cfb258d7c89e880e36fe0cfae9bf88e0808f63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1996bd0a71360d16ed1f51b4f2780032741d8205b97b0854b94f9691a05c741eccb491c7d4468571b5ebd3ef3dacd2d5da6997cee46a94e5a4cc962ee98799db
|
7
|
+
data.tar.gz: 9c5427c47051827e4a4c9ef3250f3770359be8e282915cd85d61b8d1695cebd8d23241a25da23751b6f793ae2b9af8c68c476da7f1beef5e0be3ede4741b00dd
|
@@ -19,7 +19,7 @@ module Inventory
|
|
19
19
|
version = facts[@config[:version_key]] || @config[:version_default]
|
20
20
|
|
21
21
|
schema_type_file = File.join @config[:json_schema_dir], "#{type}.json"
|
22
|
-
schema_version_file = File.join @config[:json_schema_dir], type, "#{version}.json"
|
22
|
+
schema_version_file = File.join @config[:json_schema_dir], type.to_s, "#{version}.json"
|
23
23
|
|
24
24
|
if File.file? schema_type_file
|
25
25
|
InventoryLogger.logger.info "Use JSON Schema #{schema_type_file}"
|
@@ -29,6 +29,14 @@ RSpec.describe Inventory::Server::JsonSchemaValidator, '#call' do
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
context "with type and version integer" do
|
33
|
+
env = { :facts => { 'key' => 'value', 'type' => 1, 'version' => 1.0} }
|
34
|
+
it "should pass" do
|
35
|
+
result = Inventory::Server::JsonSchemaValidator.new(noop, config).call(env)
|
36
|
+
expect(result).to eq 42
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
32
40
|
context "with facts" do
|
33
41
|
env = { :facts => { 'key' => 'value', 'type' => 'my_fact', 'version' => 'my_version' } }
|
34
42
|
|