sensu-plugin 2.0.2 → 2.1.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-plugin.rb +1 -1
- data/lib/sensu-plugin/utils.rb +11 -0
- data/test/cast_bool_value_test.rb +31 -0
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fa20b06e805a4910513f35e0d49e04190c04618
|
4
|
+
data.tar.gz: 875707ed61b5a30a87aa13350f857d6836582fad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7d2b872c3322ccc4e43e56329a54b3e9fba0cdae70ed9fadcadc1276ff82e12108c6bc297e668c81ca97dfb8bcf212903b5cd4192399c2047829de316c93c04
|
7
|
+
data.tar.gz: bee33bfaee01fe9f133c2f92699e80e1bea059117952085afbe3ece721bb7d3072b85742e5204110c6e7966509de03561dc271dfafe094072cd3a6e1d23915a9
|
data/lib/sensu-plugin.rb
CHANGED
data/lib/sensu-plugin/utils.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'sensu-plugin/utils'
|
3
|
+
|
4
|
+
class TestCastBoolInt < MiniTest::Test
|
5
|
+
include SensuPluginTestHelper
|
6
|
+
include Sensu::Plugin::Utils
|
7
|
+
|
8
|
+
def test_integer
|
9
|
+
assert_equal 567.89, cast_bool_values_int(567.89)
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_false_boolean
|
13
|
+
assert_equal 0, cast_bool_values_int(false)
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_true_boolean
|
17
|
+
assert_equal 1, cast_bool_values_int(true)
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_false_string
|
21
|
+
assert_equal 0, cast_bool_values_int('false')
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_true_string
|
25
|
+
assert_equal 1, cast_bool_values_int('true')
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_arbirtrary_string
|
29
|
+
assert_equal 'foo', cast_bool_values_int('foo')
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Decklin Foster
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-07-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -29,16 +29,16 @@ dependencies:
|
|
29
29
|
name: mixlib-cli
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 1.5.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 1.5.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/sensu-plugin/cli.rb
|
83
83
|
- lib/sensu-plugin/metric/cli.rb
|
84
84
|
- lib/sensu-plugin/utils.rb
|
85
|
+
- test/cast_bool_value_test.rb
|
85
86
|
- test/deep_merge_test.rb
|
86
87
|
- test/external_check_test.rb
|
87
88
|
- test/external_handler_argument_test.rb
|
@@ -111,17 +112,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
112
|
version: '0'
|
112
113
|
requirements: []
|
113
114
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.4.5.1
|
115
116
|
signing_key:
|
116
117
|
specification_version: 4
|
117
118
|
summary: Sensu Plugins
|
118
119
|
test_files:
|
119
|
-
- test/external_check_test.rb
|
120
120
|
- test/handle_helper_test.rb
|
121
|
+
- test/external_handler_test.rb
|
121
122
|
- test/external_metric_test.rb
|
122
123
|
- test/handle_filter_test.rb
|
124
|
+
- test/external_check_test.rb
|
125
|
+
- test/external_handler_argument_test.rb
|
126
|
+
- test/cast_bool_value_test.rb
|
123
127
|
- test/deep_merge_test.rb
|
124
128
|
- test/mutator_test.rb
|
125
129
|
- test/test_helper.rb
|
126
|
-
- test/external_handler_argument_test.rb
|
127
|
-
- test/external_handler_test.rb
|