kapnismology 1.10.0 → 1.11.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29e92cc0b15350453a3ef92a2fd8299d66a3e3d9
|
4
|
+
data.tar.gz: b804388fb355e1afb4ccc6e41af8036808eb5e28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dda24022b80c738002ced4a8bab8475bf995d015ee07d1f6b6fc5f1a19f7f0414184e3fbbc5055ea4c11c22ee5197a490a83b492d16800f05a485609a6c1124
|
7
|
+
data.tar.gz: 912eb47c4d383ccffc1c49da32fbb954e57db7c0af55e8ebe70f79144f8669ad6fab1bf7ec37ccb06a5989d7ba7f935bc805e9fee1c43f33a5ec838e8d9896af
|
@@ -4,9 +4,10 @@ require 'kapnismology/terminal'
|
|
4
4
|
module Kapnismology
|
5
5
|
# Mapping of test_name => returned result for each smoke test
|
6
6
|
class Evaluation
|
7
|
+
attr_reader :result
|
7
8
|
def initialize(test_class)
|
8
9
|
@name = test_class.name.split('::').last
|
9
|
-
@result = test_class.new.__result__
|
10
|
+
@result = test_class.new.__result__
|
10
11
|
end
|
11
12
|
|
12
13
|
def passed?
|
@@ -21,10 +22,5 @@ module Kapnismology
|
|
21
22
|
@result.to_s(@name)
|
22
23
|
end
|
23
24
|
|
24
|
-
private
|
25
|
-
|
26
|
-
def unavailable_result
|
27
|
-
Result.new(false, {}, 'This test has not returned any result.')
|
28
|
-
end
|
29
25
|
end
|
30
26
|
end
|
@@ -26,8 +26,10 @@ module Kapnismology
|
|
26
26
|
private
|
27
27
|
|
28
28
|
def evaluations
|
29
|
-
@evaluations ||= @smoke_tests_classes.
|
30
|
-
Evaluation.new(klass)
|
29
|
+
@evaluations ||= @smoke_tests_classes.inject([]) do |memo, klass|
|
30
|
+
evaluation = Evaluation.new(klass)
|
31
|
+
memo << evaluation if !evaluation.result.class.ancestors.include?(Kapnismology::NotApplicableResult)
|
32
|
+
memo
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
data/lib/kapnismology/result.rb
CHANGED
@@ -82,6 +82,9 @@ eos
|
|
82
82
|
class NullResult < InfoResult
|
83
83
|
end
|
84
84
|
|
85
|
+
class NotApplicableResult < BaseResult
|
86
|
+
end
|
87
|
+
|
85
88
|
# Use this class when your test is not valid in the current situation
|
86
89
|
# For instance when you have a test for deployments that have not happen, etc.
|
87
90
|
class Success < BaseResult
|
@@ -20,9 +20,9 @@ module Kapnismology
|
|
20
20
|
def result
|
21
21
|
end
|
22
22
|
|
23
|
-
# Internally Kapnismology is calling this method. We are handling exceptions under the hood
|
23
|
+
# Internally Kapnismology is calling this method. We are handling exceptions under the hood here
|
24
24
|
def __result__
|
25
|
-
result_object = result
|
25
|
+
result_object = result || Result.new(false, {}, 'This test has not returned any result.')
|
26
26
|
unless result_object.class.ancestors.include?(Kapnismology::BaseResult)
|
27
27
|
message = "Smoke test #{self.class}, returned #{result_object.class} instead of a Result"
|
28
28
|
result_object = Result.new(false, { returned_class: result_object.class }, message)
|
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.11.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-
|
11
|
+
date: 2016-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
181
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.
|
182
|
+
rubygems_version: 2.5.1
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: Engine for smoke tests.
|