sensu-settings 1.5.0 → 1.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e72fe5365f84e168ecba9e968e10144f82b5e0c
4
- data.tar.gz: 751ba3579d6607a39680169b843a1d28712b3e18
3
+ metadata.gz: 54d0111bccce26545cf3c41ed61ec4fbfd550ce4
4
+ data.tar.gz: 5453d340333900902d7eab3fedae5438aa4b1718
5
5
  SHA512:
6
- metadata.gz: 1a0b99410152970c6c8c06ce2a94067a43fb5df60da73f9dd14f9f2ce25f758f8eb4042e4cb2e461df671568ed3791e1120d76c06c17012242084551c9f811d9
7
- data.tar.gz: cb15d29086c2a50c438f0114406be939b5e378dcfe371c0a5b5905613e2aa36606ea0e0bab07db2649ab661a8c2b8cb60606194f6780abe2c75a78deef4a34df
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-settings"
5
- spec.version = "1.5.0"
5
+ spec.version = "1.6.0"
6
6
  spec.authors = ["Sean Porter"]
7
7
  spec.email = ["portertech@gmail.com"]
8
8
  spec.summary = "The Sensu settings library, loader and validator"
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter