sensu-settings 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sensu/settings/validators/api.rb +2 -2
- data/sensu-settings.gemspec +1 -1
- data/spec/validator_spec.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54d0111bccce26545cf3c41ed61ec4fbfd550ce4
|
4
|
+
data.tar.gz: 5453d340333900902d7eab3fedae5438aa4b1718
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22eeed17690307c1335e314fa8a69ef727c4685a4a6a5c0e12ee2c6c5aa868f5481d5ec2dc678e64db99c0475751fa064e4d97c5e276b3afa37adc75f0503080
|
7
|
+
data.tar.gz: 7e89473c1889695fb5c238e73e0fc57026b4025291a7cc1932731b9e9485f3838687640011f23cb2b22b9cb85c67a4e9b33e19eb68e1a733b5ffa89e4dde9bb7
|
@@ -20,14 +20,14 @@ module Sensu
|
|
20
20
|
#
|
21
21
|
# @param api [Hash] sensu api definition.
|
22
22
|
def validate_api(api)
|
23
|
+
must_be_a_hash_if_set(api) ||
|
24
|
+
invalid(api, "api must be a hash")
|
23
25
|
if is_a_hash?(api)
|
24
26
|
must_be_an_integer_if_set(api[:port]) ||
|
25
27
|
invalid(api, "api port must be an integer")
|
26
28
|
must_be_a_string_if_set(api[:bind]) ||
|
27
29
|
invalid(api, "api bind must be a string")
|
28
30
|
validate_api_authentication(api)
|
29
|
-
else
|
30
|
-
invalid(api, "api must be a hash")
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
data/sensu-settings.gemspec
CHANGED
data/spec/validator_spec.rb
CHANGED
@@ -595,6 +595,9 @@ describe "Sensu::Settings::Validator" do
|
|
595
595
|
end
|
596
596
|
|
597
597
|
it "can validate an api definition" do
|
598
|
+
api = nil
|
599
|
+
@validator.validate_api(api)
|
600
|
+
expect(@validator.reset).to eq(0)
|
598
601
|
api = true
|
599
602
|
@validator.validate_api(api)
|
600
603
|
expect(@validator.reset).to eq(1)
|