kapnismology 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fadb67885456f40120baf78b978ef156e428ec03
4
- data.tar.gz: 5b14571e2df67b33387ee38a6fb585563a0baf0b
3
+ metadata.gz: 859b57ad0bcfd973ac47d94e81b75b08cb2cb41f
4
+ data.tar.gz: b4734961ff460248b62bfca45ef56e4c4e4e64f4
5
5
  SHA512:
6
- metadata.gz: 9da6e31cd9da8f4c9a89321afcccfa5ecfb2059cbb01ef51632325dfd21e376785953e970d99fecf601f0cdaa18644475fdbb650dd4fce7a6c12eb3536970314
7
- data.tar.gz: 628969468c630490b3ffce6b86d6bca1ac35ee2db3148e53f60f180eafee6b401c910315715cdb0c359e1482f4a36269ecc790fc750c656912a6690af084e10f
6
+ metadata.gz: b9033c19388df24b171acaca2691a88b9f0391a4bdf9196dcd994ced6b37e7f0f5a864cc18dea89b0c797437fe039ce82e637d6c6fd0891df74d8429b5470b3d
7
+ data.tar.gz: 5496ba4b9cea4d3ab606833b17a510aceb0656ba0b4990ec3c8e106432679b7ffef480f0d10ff35a37a9311ab49e811e9a4f39a803d3f3df03ff73a037117ffc
data/README.md CHANGED
@@ -56,16 +56,17 @@ smoke test class.
56
56
 
57
57
  ## Not runnable tests
58
58
 
59
- If your test find a situation when it does not make sense, then you can return a `Kapnismology::UnTestableResult` instead of a `Kapnismology::Result`. Like:
59
+ If your test find a situation when it does not make sense, then you can return a `Kapnismology::NullResult` instead of a `Kapnismology::Result`. Like:
60
60
  ```
61
61
  if (File.exist?('that file'))
62
62
  Result.new(....)
63
63
  else
64
- UnTestableResult.new
64
+ NullResult.new
65
65
  end
66
66
  ```
67
67
 
68
- UnTestableResult do not need any parameter.
68
+ Be very careful of not returning NullResult when you should be returning a failing Result.
69
+ NullResult do not need any parameter but you can optionally pass a message.
69
70
 
70
71
  ## Tagging and running tags
71
72
 
@@ -12,12 +12,12 @@ module Kapnismology
12
12
  @result.passed?
13
13
  end
14
14
 
15
+ def null_result?
16
+ @result.is_a?(NullResult)
17
+ end
18
+
15
19
  def as_json(_options = nil)
16
- if @result.is_a?(Result)
17
- { @name => @result.to_hash }
18
- else
19
- {}
20
- end
20
+ { @name => @result.to_hash }
21
21
  end
22
22
 
23
23
  def to_s
@@ -20,7 +20,7 @@ module Kapnismology
20
20
  end
21
21
 
22
22
  def to_json
23
- evaluations.to_json
23
+ evaluations.delete_if{ |evaluation| evaluation.null_result? }.to_json
24
24
  end
25
25
 
26
26
  private
@@ -26,9 +26,9 @@ module Kapnismology
26
26
 
27
27
  # Use this class when your test is not valid in the current situation
28
28
  # For instance when you have a test for deployments that have not happen, etc.
29
- class UnTestableResult
29
+ class NullResult
30
30
  attr_reader :message
31
- def initialize(message = 'The result could not tested')
31
+ def initialize(message = 'The result could not be determined')
32
32
  @message = message
33
33
  end
34
34
  def passed?
@@ -1,3 +1,3 @@
1
1
  module Kapnismology
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kapnismology
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordi Polo Carres
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  version: '0'
176
176
  requirements: []
177
177
  rubyforge_project:
178
- rubygems_version: 2.5.1
178
+ rubygems_version: 2.4.8
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: Engine for smoke tests.