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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbd621f0387cf288bfa32a43784b7ba92b020f6e
4
- data.tar.gz: 6a1c5b6146fe86811c77a9aad9fb3adc9b88b5b9
3
+ metadata.gz: 6775943c47bb7c69f3f3992daa5431b6b65cb8d2
4
+ data.tar.gz: 1055c6ce7d0bad4a245c15116f31db3ada41bb95
5
5
  SHA512:
6
- metadata.gz: 13d340c969350eba069680e6b8bcb8a9327ce05c63b31fc366f52c31de57aaf588ba95c038672a358c8d0748dc6dbc3680522332efa9218a4bd1c81091c6c294
7
- data.tar.gz: c7c5f8096788f20db177cb30b7f4902f87c8d8879534a7553b57d36e1376c2442d973d439f434b3d1bc6c47f23b26ecb9a2b634eb6f7183efecdcaf243a003d3
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 test find a situation when it does not make sense, then you can return a `NullResult` instead of a `Result`. Like:
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
- NullResult.new
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 NullResult when you should be returning a failing Result.
93
- NullResult do not need any parameter but you can optionally pass a message.
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
 
@@ -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 return an assertion on if
60
- # it passed or not.
61
- class NullResult < BaseResult
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
- # Redefining for unique output
75
- def to_s(name)
76
- <<-eos
77
- #{Terminal.yellow('Skipped')}: #{name}
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
@@ -1,3 +1,3 @@
1
1
  module Kapnismology
2
- VERSION = '1.9.0'.freeze
2
+ VERSION = '1.10.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.9.0
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-15 00:00:00.000000000 Z
11
+ date: 2016-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails