kapnismology 1.7.0 → 1.8.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: a71f19f3000d41004864b28c10f41b3f147f7868
4
- data.tar.gz: fa3dcaeda42ddb19d05bcfc0b308cbf8bef70327
3
+ metadata.gz: f5ee6f38b81e3a8b7bcf13f458f41b6b4030a854
4
+ data.tar.gz: 647605746bcc937c4d84ff2958d1ccde2d0ebbbc
5
5
  SHA512:
6
- metadata.gz: 05350329b7cbfac2f6dc72a30a44dc6f168cb0f23b64324d6d85c87b1353144b886945d7c4608e6f2fc08fe27da7aa9d7b944f78a14b53447452f47dc32ddff1
7
- data.tar.gz: f6c7a55968f13f3ca421696cfaa1ac45bfd34d20a4345e582a50ce8f7dc76ba755aabd9de9779d1506036672938b09ac8abd163acde779fd77e19caa5c94717f
6
+ metadata.gz: da8fda758a183398fbdcaa9b65b81b5644c73fe30204a2185316c5f99aba7b00fc4ac0b9972da10a654e92b593a48bf83815862fcfef65cce1948f17d5616bcf
7
+ data.tar.gz: 4b55329d5e23f58e9bf4857598aedd38d888e58669a46999fa6acaa263216a573285fd99a800c0e1d296501f375a2ed2c26a91db6900753a9f1c84ff8452c763
data/README.md CHANGED
@@ -159,6 +159,18 @@ end
159
159
  Using small methods that raise SmokeTestFailed when failed will help you write an easy to read `result` method.
160
160
 
161
161
 
162
+ ## Testing
163
+
164
+ There is a Kapnismology::SpecHelper which can be useful when running your tests.
165
+ Usage:
166
+ ```
167
+ RSpec.describe DatabaseSmokeTest do
168
+ let(:result) { Kapnismology::SpecHelper.result_for(described_class.new) }
169
+ ...
170
+ ```
171
+
172
+ `result` will be processed so you do not need to deal with the internals of Kapnismology but just check the properties of a Result object
173
+
162
174
  ## TODO
163
175
 
164
176
  - Automount routes
@@ -1,8 +1,8 @@
1
1
  require 'kapnismology/terminal'
2
2
  module Kapnismology
3
3
  class RakeTask
4
- def output
5
- evaluations = SmokeTestCollection.evaluations
4
+ def output(allowed_tags = [SmokeTest::RUNTIME_TAG], blacklist = [])
5
+ evaluations = SmokeTestCollection.evaluations(allowed_tags, blacklist)
6
6
  puts
7
7
  puts
8
8
  evaluations.each do |evaluation|
@@ -17,7 +17,6 @@ module Kapnismology
17
17
  end
18
18
 
19
19
  def result
20
-
21
20
  end
22
21
 
23
22
  def __result__
@@ -65,6 +64,7 @@ module Kapnismology
65
64
  @data = data
66
65
  @message = message
67
66
  end
67
+
68
68
  def result
69
69
  Kapnismology::Result.new(false, @data, @message)
70
70
  end
@@ -1,7 +1,6 @@
1
1
  require 'kapnismology/evaluation_collection'
2
2
 
3
3
  module Kapnismology
4
-
5
4
  # This class maintains the collection of all the smoke tests found in the system
6
5
  class SmokeTestCollection
7
6
  class << self
@@ -0,0 +1,20 @@
1
+ require 'kapnismology/result'
2
+
3
+ module Kapnismology
4
+ class RSpecResult < BaseResult
5
+ attr_reader :data, :message, :extra_messages # Deprecated but many users test on these properties
6
+ def initialize(result)
7
+ hash = result.to_hash
8
+ @data = hash[:data]
9
+ @message = hash[:message]
10
+ @passed = hash[:passed]
11
+ @extra_messages = hash[:extra_messages]
12
+ end
13
+ end
14
+
15
+ class SpecHelper
16
+ def self.result_for(object)
17
+ RSpecResult.new(object.__result__)
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module Kapnismology
2
- VERSION = '1.7.0'.freeze
2
+ VERSION = '1.8.0'.freeze
3
3
  end
data/lib/kapnismology.rb CHANGED
@@ -6,3 +6,4 @@ require 'kapnismology/evaluation_collection'
6
6
  require 'kapnismology/rake_task'
7
7
  require 'kapnismology/smoke_test'
8
8
  require 'kapnismology/smoke_test_collection'
9
+ require 'kapnismology/spec_helper'
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.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordi Polo Carres
@@ -155,6 +155,7 @@ files:
155
155
  - lib/kapnismology/result.rb
156
156
  - lib/kapnismology/smoke_test.rb
157
157
  - lib/kapnismology/smoke_test_collection.rb
158
+ - lib/kapnismology/spec_helper.rb
158
159
  - lib/kapnismology/terminal.rb
159
160
  - lib/kapnismology/version.rb
160
161
  homepage: https://www.github.com/JordiPolo/kapnismology