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: 6775943c47bb7c69f3f3992daa5431b6b65cb8d2
4
- data.tar.gz: 1055c6ce7d0bad4a245c15116f31db3ada41bb95
3
+ metadata.gz: 29e92cc0b15350453a3ef92a2fd8299d66a3e3d9
4
+ data.tar.gz: b804388fb355e1afb4ccc6e41af8036808eb5e28
5
5
  SHA512:
6
- metadata.gz: 7b7d56da91f8eee7adee9d8ce22351a75f5f8bbd5760110980dfcdc9d06cfa1486a615f24d962aa5b1ad386e0ce6cddbfa0e6ff02f71304324dd48e1131874ee
7
- data.tar.gz: 66a2ecc1ab381a48fa6094a100bd15e83cccae02d194c4068b19707d2802cb4a9a5950f785a0e401bf9dc54d34608ac103f165d76cc1372e446a0e6f28507813
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__ || unavailable_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.map do |klass|
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
@@ -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 herer
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)
@@ -1,3 +1,3 @@
1
1
  module Kapnismology
2
- VERSION = '1.10.0'.freeze
2
+ VERSION = '1.11.0'.freeze
3
3
  end
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.10.0
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-03-16 00:00:00.000000000 Z
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.4.8
182
+ rubygems_version: 2.5.1
183
183
  signing_key:
184
184
  specification_version: 4
185
185
  summary: Engine for smoke tests.