sensu-plugin 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  module Sensu
2
2
  module Plugin
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  EXIT_CODES = {
5
5
  'OK' => 0,
6
6
  'WARNING' => 1,
@@ -52,9 +52,9 @@ module Sensu
52
52
  rescue SystemExit => e
53
53
  exit e.status
54
54
  rescue Exception => e
55
- self.new.critical "Check failed to run: #{e.message}, #{e.backtrace}"
55
+ check.critical "Check failed to run: #{e.message}, #{e.backtrace}"
56
56
  end
57
- self.new.warning "Check did not exit! You should call an exit code method."
57
+ check.warning "Check did not exit! You should call an exit code method."
58
58
  end
59
59
 
60
60
  end
@@ -38,6 +38,11 @@ class TestCheckExternal < MiniTest::Unit::TestCase
38
38
  assert $?.exitstatus == 1
39
39
  end
40
40
 
41
+ def test_exception
42
+ output = run_script '-f'
43
+ assert $?.exitstatus == 2 && output.include?('failed')
44
+ end
45
+
41
46
  def test_argv
42
47
  output = run_script '-o', 'foo'
43
48
  assert $?.exitstatus == 0 && output.include?('argv = foo')
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: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-07 00:00:00.000000000 Z
12
+ date: 2012-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70146182369580 !ruby/object:Gem::Requirement
16
+ requirement: &70294828191900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70146182369580
24
+ version_requirements: *70294828191900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mixlib-cli
27
- requirement: &70146182367580 !ruby/object:Gem::Requirement
27
+ requirement: &70294828189640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 1.1.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70146182367580
35
+ version_requirements: *70294828189640
36
36
  description: Plugins and helper libraries for Sensu, a monitoring framework
37
37
  email:
38
38
  - decklin@red-bean.com