kapnismology 1.2.0 → 1.3.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: 70d3764f51e40905e0c74286d44fe240c53e6442
4
- data.tar.gz: c9b540c684a35cf5fcdb0f9e42fef758343c61e0
3
+ metadata.gz: fadb67885456f40120baf78b978ef156e428ec03
4
+ data.tar.gz: 5b14571e2df67b33387ee38a6fb585563a0baf0b
5
5
  SHA512:
6
- metadata.gz: 8cec61255a0a42fa3924c6a75740aa357ff5feffb23f0cc3613b3a2865a24c575dff939352b30a2cf4fefd66c7972cb01b40f5aa0a665dc64407545fa62fc0f4
7
- data.tar.gz: dbad4acbaedadf5199fe0839b6f14220e159de577e1a1e799448428069346f1e79f12e4f8089c6b3dd67bc57143c6bd9375c1186688ead066126a4a499bc2bb0
6
+ metadata.gz: 9da6e31cd9da8f4c9a89321afcccfa5ecfb2059cbb01ef51632325dfd21e376785953e970d99fecf601f0cdaa18644475fdbb650dd4fce7a6c12eb3536970314
7
+ data.tar.gz: 628969468c630490b3ffce6b86d6bca1ac35ee2db3148e53f60f180eafee6b401c910315715cdb0c359e1482f4a36269ecc790fc750c656912a6690af084e10f
data/README.md CHANGED
@@ -54,6 +54,18 @@ If for any reason you want to have your test in any other location, then you wil
54
54
  If you want to change the name of the test, define `self.name` in your
55
55
  smoke test class.
56
56
 
57
+ ## Not runnable tests
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:
60
+ ```
61
+ if (File.exist?('that file'))
62
+ Result.new(....)
63
+ else
64
+ UnTestableResult.new
65
+ end
66
+ ```
67
+
68
+ UnTestableResult do not need any parameter.
57
69
 
58
70
  ## Tagging and running tags
59
71
 
@@ -13,7 +13,11 @@ module Kapnismology
13
13
  end
14
14
 
15
15
  def as_json(_options = nil)
16
- { @name => @result.to_hash }
16
+ if @result.is_a?(Result)
17
+ { @name => @result.to_hash }
18
+ else
19
+ {}
20
+ end
17
21
  end
18
22
 
19
23
  def to_s
@@ -23,4 +23,16 @@ module Kapnismology
23
23
  { passed: passed?, data: @data, message: @message }
24
24
  end
25
25
  end
26
+
27
+ # Use this class when your test is not valid in the current situation
28
+ # For instance when you have a test for deployments that have not happen, etc.
29
+ class UnTestableResult
30
+ attr_reader :message
31
+ def initialize(message = 'The result could not tested')
32
+ @message = message
33
+ end
34
+ def passed?
35
+ true
36
+ end
37
+ end
26
38
  end
@@ -1,3 +1,3 @@
1
1
  module Kapnismology
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.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.2.0
4
+ version: 1.3.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-02-28 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails