sensu-settings 1.2.0 → 1.3.0

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: a5afc7c7ef4a3cfc41e5a052c2133371dade84f1
4
- data.tar.gz: 2345400d3a76e5b7b275866baf577f52875bc4e8
3
+ metadata.gz: b52b0d7d44f148e43deac0e2450f8e023bc5a6f3
4
+ data.tar.gz: f9b954ae820cc6256c3ea5981ec2b4fd8b8e9655
5
5
  SHA512:
6
- metadata.gz: daa43044a9e2ac530ea62f613ebe86aefaf2b734a499f4c8b098c8b5e0480041e099c2d31cd8489791894d94745941a7c950bf627544363cf4dc9f2e3c7487fe
7
- data.tar.gz: a95609dba6b6631c75be0d20d0c1d454386d0bc8969912cef9005abd7c91bfc412efd507c0510a75cbfeb03ca5f52c6e539b8f3ac224959dde1e2555587751fd
6
+ metadata.gz: 08b52a7c91d24a07b79e116d628bbfe591f5396c43abe6632f4bce65f7c3793eeae5f447b226690076122caf72587e25cb56d9c1b645a7d84d4745dbeda374da
7
+ data.tar.gz: c5f8afca71385402593b9615b976086218f439504c95fa0b9b2debf64e22e58f54c4cb384d470d7de9cdaa5ed03b3bbc2292b59d803b1992c7d177858037fec6
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
4
  - 1.8.7
@@ -61,8 +61,12 @@ module Sensu
61
61
  invalid(check, "check name must be a string")
62
62
  must_match_regex(/^[\w\.-]+$/, check[:name]) ||
63
63
  invalid(check, "check name cannot contain spaces or special characters")
64
- must_be_a_string(check[:command]) ||
64
+ must_be_a_string_if_set(check[:command]) ||
65
65
  invalid(check, "check command must be a string")
66
+ must_be_a_string_if_set(check[:extension]) ||
67
+ invalid(check, "check extension must be a string")
68
+ (!check[:command].nil? ^ !check[:extension].nil?) ||
69
+ invalid(check, "either check command or extension must be set")
66
70
  must_be_a_numeric_if_set(check[:timeout]) ||
67
71
  invalid(check, "check timeout must be numeric")
68
72
  must_be_a_string_if_set(check[:source]) ||
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-settings"
5
- spec.version = "1.2.0"
5
+ spec.version = "1.3.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"
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency "bundler", "~> 1.6"
21
21
  spec.add_development_dependency "rake"
22
22
  spec.add_development_dependency "rspec"
23
- spec.add_development_dependency "codeclimate-test-reporter"
23
+ spec.add_development_dependency "codeclimate-test-reporter" unless RUBY_VERSION < "1.9"
24
24
  end
@@ -57,9 +57,8 @@ describe "Sensu::Settings::Validator" do
57
57
  reasons = @validator.failures.map do |failure|
58
58
  failure[:message]
59
59
  end
60
- expect(reasons).to include("check name must be a string")
61
60
  expect(reasons).to include("check name cannot contain spaces or special characters")
62
- expect(reasons).to include("check command must be a string")
61
+ expect(reasons).to include("either check command or extension must be set")
63
62
  expect(reasons).to include("check interval must be an integer")
64
63
  expect(reasons).to include("check subscribers must be an array")
65
64
  expect(reasons.size).to eq(5)
@@ -147,6 +146,15 @@ describe "Sensu::Settings::Validator" do
147
146
  check[:source] = "switch-%42%"
148
147
  @validator.validate_check(check)
149
148
  expect(@validator.reset).to eq(0)
149
+ check[:extension] = 'foo'
150
+ @validator.validate_check(check)
151
+ expect(@validator.reset).to eq(1)
152
+ check.delete(:command)
153
+ @validator.validate_check(check)
154
+ expect(@validator.reset).to eq(0)
155
+ check[:extension] = true
156
+ @validator.validate_check(check)
157
+ expect(@validator.reset).to eq(1)
150
158
  end
151
159
 
152
160
  it "can validate check subdue" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-29 00:00:00.000000000 Z
11
+ date: 2015-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -153,4 +153,3 @@ test_files:
153
153
  - spec/rules_spec.rb
154
154
  - spec/settings_spec.rb
155
155
  - spec/validator_spec.rb
156
- has_rdoc: