kapnismology 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/kapnismology/result.rb +11 -10
- data/lib/kapnismology/smoke_test.rb +2 -0
- data/lib/kapnismology/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6775943c47bb7c69f3f3992daa5431b6b65cb8d2
|
4
|
+
data.tar.gz: 1055c6ce7d0bad4a245c15116f31db3ada41bb95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b7d56da91f8eee7adee9d8ce22351a75f5f8bbd5760110980dfcdc9d06cfa1486a615f24d962aa5b1ad386e0ce6cddbfa0e6ff02f71304324dd48e1131874ee
|
7
|
+
data.tar.gz: 66a2ecc1ab381a48fa6094a100bd15e83cccae02d194c4068b19707d2802cb4a9a5950f785a0e401bf9dc54d34608ac103f165d76cc1372e446a0e6f28507813
|
data/README.md
CHANGED
@@ -80,17 +80,17 @@ Will produce:
|
|
80
80
|
|
81
81
|
## Not runnable tests
|
82
82
|
|
83
|
-
If your
|
84
|
-
```
|
83
|
+
If your check finds a situation when it does not make sense to test, you can return a `InfoResult` instead of a `Result`. Like:
|
84
|
+
```ruby
|
85
85
|
if (File.exist?('necessary file'))
|
86
86
|
Result.new(....)
|
87
87
|
else
|
88
|
-
|
88
|
+
InfoResult.new({}, 'There is no need to run this test')
|
89
89
|
end
|
90
90
|
```
|
91
91
|
|
92
|
-
Be very careful of not returning
|
93
|
-
|
92
|
+
Be very careful of not returning InfoResult when you should be returning a failing Result.
|
93
|
+
|
94
94
|
|
95
95
|
## Tagging and running tags
|
96
96
|
|
data/lib/kapnismology/result.rb
CHANGED
@@ -56,9 +56,9 @@ eos
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
# This class can be returned when a check do not want to
|
60
|
-
# it
|
61
|
-
class
|
59
|
+
# This class can be returned when a check do not want to assert if it passed or not.
|
60
|
+
# Instead it can return certain information about the check or the system.
|
61
|
+
class InfoResult < BaseResult
|
62
62
|
def initialize(data, message = 'The result could not be determined')
|
63
63
|
@passed = true
|
64
64
|
@data = data
|
@@ -71,16 +71,17 @@ eos
|
|
71
71
|
{ data: @data, message: @message, extra_messages: @extra_messages }
|
72
72
|
end
|
73
73
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
#{format_extra_messages(@extra_messages)}#{Terminal.bold(@message)}
|
79
|
-
#{@data}
|
80
|
-
eos
|
74
|
+
private
|
75
|
+
|
76
|
+
def format_passed(_passed)
|
77
|
+
Terminal.yellow('Skipped')
|
81
78
|
end
|
82
79
|
end
|
83
80
|
|
81
|
+
# Deprecated NullResult class provided for compatibility.
|
82
|
+
class NullResult < InfoResult
|
83
|
+
end
|
84
|
+
|
84
85
|
# Use this class when your test is not valid in the current situation
|
85
86
|
# For instance when you have a test for deployments that have not happen, etc.
|
86
87
|
class Success < BaseResult
|
@@ -58,6 +58,8 @@ module Kapnismology
|
|
58
58
|
# These classes makes it very simple to implementors of results to use them without the module name
|
59
59
|
class Result < Kapnismology::Result
|
60
60
|
end
|
61
|
+
class InfoResult < Kapnismology::InfoResult
|
62
|
+
end
|
61
63
|
class NullResult < Kapnismology::NullResult
|
62
64
|
end
|
63
65
|
class Success < Kapnismology::Success
|
data/lib/kapnismology/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kapnismology
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordi Polo Carres
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|