rspec-nagios-formatter 0.1.0 → 0.1.1

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: 4240c25f93392c262ce1fb69d05cfb483b1b6075
4
- data.tar.gz: 4ce8435fc6d4de3424de10c1e680175900fa5bea
3
+ metadata.gz: e7640c3e6b0a04f313e1d7af013b74a8edaf1655
4
+ data.tar.gz: 4079732f36f692b24b75b73fb3f83637afab54a7
5
5
  SHA512:
6
- metadata.gz: 6f95fe8a95ab32fa17e5dbeb562ed5693e69fc537c02e3c7d9f23c07c53c1c78164e50c57da095dcbe0415101dbc54afea752cf061e65f3b75abbe66a27b69c6
7
- data.tar.gz: f547a3190089bba1938f4ad834c82ddc442a1a592137a742ff86fc5cd35c834cf23bd1126ae04c1abc41030323d13d5a67692b4004d8d945c916a4a50ecbe19c
6
+ metadata.gz: 400ca594178a95806bd8da013f56687c97958c38359d7888ca6588a9a1dca2a23c893e7f85aa867631c1bc84831e55a03c96ae940652cb225c648b17a50cf368
7
+ data.tar.gz: 5ffc5ba0c9ec4c8975f8a55cabad6b31394c329749d230aa68e474a7cc34e0022a2114fcc6cce5a752d690231f5ef814dde3da4624bbe9c31b2f56afc5ee20e1
data/bin/check_rspec CHANGED
@@ -36,7 +36,14 @@ rescue Timeout::Error
36
36
  exit EXIT_CRITICAL
37
37
  end
38
38
 
39
- puts cmd_stdout
39
+ if cmd_stdout.length > 0
40
+ puts cmd_stdout
41
+ else
42
+ # if nothing was output on stdout, print the first line of stderr
43
+ puts "RSPEC Critical - #{cmd_stderr.split("\n")[0]}"
44
+ exit EXIT_CRITICAL
45
+ end
46
+
40
47
  unless cmd_status.exitstatus == 0
41
48
  exit EXIT_CRITICAL
42
49
  end
@@ -29,3 +29,15 @@ Scenario: run a failing rspec test
29
29
  """
30
30
  ^RSPEC Critical - 1 example, 1 failures, finished in 0.\d+ seconds | examples=1 passing=0 failures=1 pending=0 conformance=0% time=0.\d+s$
31
31
  """
32
+
33
+ Scenario: rspec dies
34
+ Given a file named "trivial_spec.rb" with:
35
+ """
36
+ raise RuntimeError
37
+ """
38
+ When I run `check_rspec trivial_spec.rb`
39
+ Then the exit status should be 2
40
+ And it should fail with regexp:
41
+ """
42
+ ^RSPEC Critical -.+RuntimeError.+$
43
+ """
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Nagios
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-nagios-formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Hoblitt