kapnismology 1.8.0 → 1.8.1

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: f5ee6f38b81e3a8b7bcf13f458f41b6b4030a854
4
- data.tar.gz: 647605746bcc937c4d84ff2958d1ccde2d0ebbbc
3
+ metadata.gz: 6060f72991cd4cbcca36ace4e06802b245a87f01
4
+ data.tar.gz: 424a1a2cc58408b8af84157f5f2b8b9294dee7de
5
5
  SHA512:
6
- metadata.gz: da8fda758a183398fbdcaa9b65b81b5644c73fe30204a2185316c5f99aba7b00fc4ac0b9972da10a654e92b593a48bf83815862fcfef65cce1948f17d5616bcf
7
- data.tar.gz: 4b55329d5e23f58e9bf4857598aedd38d888e58669a46999fa6acaa263216a573285fd99a800c0e1d296501f375a2ed2c26a91db6900753a9f1c84ff8452c763
6
+ metadata.gz: 6a3a0630e5829e644645f206cafced7ac3d2291eebade326483b7862ba203417a1effbeae385af53e020bb09ad164b02fd40f964e0d8369fc9ba144e8c1b7a3a
7
+ data.tar.gz: d2a60d61bd6b6ddffd447c3464626ba8bc0600b44d2777f21ac69a1b692fd039db8fc4c59ccb0b886439c89bd93ce6b2f56563760190152c55fb3e39695e4478
@@ -2,6 +2,18 @@ require 'kapnismology/result'
2
2
  require 'kapnismology/smoke_test_collection'
3
3
 
4
4
  module Kapnismology
5
+
6
+ # This class can be raised to make Kapnismology create a failed result from your smoke test
7
+ class SmokeTestFailed < StandardError
8
+ def initialize(data, message)
9
+ @data = data
10
+ @message = message
11
+ end
12
+
13
+ def result
14
+ Kapnismology::Result.new(false, @data, @message)
15
+ end
16
+ end
5
17
  #
6
18
  # This is the base class for all the smoke tests.
7
19
  # Inherit from this class and implement the result and self.name method
@@ -25,6 +37,8 @@ module Kapnismology
25
37
  message = "Smoke test #{self.class}, returned #{result_object.class} instead of a Result"
26
38
  result_object = Result.new(false, { returned_class: result_object.class }, message)
27
39
  end
40
+ rescue Kapnismology::SmokeTestFailed => e
41
+ result_object = e.result
28
42
  rescue SmokeTestFailed => e
29
43
  result_object = e.result
30
44
  rescue => e
@@ -58,16 +72,8 @@ module Kapnismology
58
72
  end
59
73
  class Success < Kapnismology::Success
60
74
  end
61
-
62
- class SmokeTestFailed < StandardError
63
- def initialize(data, message)
64
- @data = data
65
- @message = message
66
- end
67
-
68
- def result
69
- Kapnismology::Result.new(false, @data, @message)
70
- end
75
+ class SmokeTestFailed < Kapnismology::SmokeTestFailed
71
76
  end
77
+
72
78
  end
73
79
  end
@@ -1,3 +1,3 @@
1
1
  module Kapnismology
2
- VERSION = '1.8.0'.freeze
2
+ VERSION = '1.8.1'.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.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordi Polo Carres