diagnostics 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- diagnostics (0.0.2)
4
+ diagnostics (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -6,7 +6,7 @@ Feature: Diagnostic checks
6
6
  They can also contain metadata info such as attributes,
7
7
  lists, texts, and tables.
8
8
 
9
- Scenario: Status methods on a check
9
+ Scenario: Available status methods on a check
10
10
  Given a file named "status_methods.rb" with:
11
11
  """
12
12
  $:.unshift(File.dirname(__FILE__) + '/../../lib')
@@ -37,6 +37,33 @@ Feature: Diagnostic checks
37
37
 
38
38
  """
39
39
 
40
+ Scenario: A "passed" method that fails
41
+ Given a file named "failing_passed_method.rb" with:
42
+ """
43
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
44
+ require 'diagnostics'
45
+
46
+ class FailingPassedMethod
47
+ include DiagnosticsCheck
48
+
49
+ def passed; false end
50
+ end
51
+
52
+ check = diagnostic_check(:FailingPassedMethod)
53
+
54
+ puts check.passed?
55
+ puts check.failed?
56
+ puts check.status.inspect
57
+ """
58
+ When I run "ruby failing_passed_method.rb"
59
+ Then the output should contain exactly:
60
+ """
61
+ false
62
+ true
63
+ :failed
64
+
65
+ """
66
+
40
67
  Scenario: Attributes on a check
41
68
  Given a file named "attributes.rb" with:
42
69
  """
@@ -63,6 +90,8 @@ Feature: Diagnostic checks
63
90
  check.data.attributes.map do |attribute|
64
91
  puts "#{attribute.name}---#{attribute.value}"
65
92
  end
93
+ puts
94
+ puts check.status.inspect
66
95
  """
67
96
  When I run "ruby attributes.rb"
68
97
  Then the output should contain exactly:
@@ -76,6 +105,8 @@ Feature: Diagnostic checks
76
105
  Master---Up
77
106
  Slave---Down
78
107
 
108
+ :none
109
+
79
110
  """
80
111
 
81
112
  Scenario: Lists on a check
@@ -27,7 +27,9 @@ module Diagnostics
27
27
  end
28
28
 
29
29
  def failed?
30
- @failed_method_result ||= call_method(:failed)
30
+ @failed_method_result ||= call_method(:failed) || (
31
+ !passed? if instance.respond_to?(:passed)
32
+ )
31
33
  end
32
34
 
33
35
  def status
@@ -1,3 +1,3 @@
1
1
  module Diagnostics
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diagnostics
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Ko
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-23 00:00:00 -07:00
18
+ date: 2011-01-30 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -216,7 +216,7 @@ rubyforge_project: diagnostics
216
216
  rubygems_version: 1.4.2
217
217
  signing_key:
218
218
  specification_version: 3
219
- summary: diagnostics-0.0.3
219
+ summary: diagnostics-0.0.4
220
220
  test_files:
221
221
  - features/diagnostic_checks.feature
222
222
  - features/step_definitions/aruba.rb