cucumber-messages 20.0.0 → 21.0.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
  SHA256:
3
- metadata.gz: c3990dc466da3ed1fcfd89df413422c86fda8183a766ae660e0c8f25e72a4795
4
- data.tar.gz: 24308f5d7fc28df143bc0ab232ed8a9658220a4f844cde337c556b26375d61f6
3
+ metadata.gz: 8d775ee31d595dd6b7c67a8d6c98a84d18d6815c433b96aff25594c3cdcdd9f3
4
+ data.tar.gz: 79b5a45328fd019745e0d1fa5ce87c6df334956d5b9e8eb24a93e2ef7c0661a2
5
5
  SHA512:
6
- metadata.gz: 0f8686679d4ab24f6c5c4c868d4e9d59dcdcde0743855b0332a2bdcd5374a447a85bdffec1630eb1eca37c18c10b624e6aa4243047810fe2dc26dcc6bd7625c2
7
- data.tar.gz: 3a67338f63c2fa966258f8265cad066502b663bd88b0b845e1232e04894f299b4022a449c848d6419b2a939b628fc990d82a2faa586955fb53b2adc00d9c9f55
6
+ metadata.gz: d1ec82690ee4b3ada7e575f5ff2dd0fb2923e95647fdb3c1960666daaac919252d4fb796a01814f1fee8250a1654d057e5ab220b9483b4d2cc398723cc648b80
7
+ data.tar.gz: 2843fa5bf6ecb13b8ec138076e563ee34bb619c2bf8fd02704357ecf37346ed38c4deb8b8fe78748d739a6dacb10dc1772356fe78a691020ac2733177cbea0d1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 20.0.0
1
+ 21.0.1
@@ -88,6 +88,26 @@ module Cucumber
88
88
  end
89
89
  end
90
90
 
91
+ class Exception
92
+
93
+ ##
94
+ # Returns a new Exception from the given hash.
95
+ # If the hash keys are camelCased, they are properly assigned to the
96
+ # corresponding snake_cased attributes.
97
+ #
98
+ # Cucumber::Messages::Exception.from_h(some_hash) # => #<Cucumber::Messages::Exception:0x... ...>
99
+ #
100
+
101
+ def self.from_h(hash)
102
+ return nil if hash.nil?
103
+
104
+ self.new(
105
+ type: hash[:type],
106
+ message: hash[:message],
107
+ )
108
+ end
109
+ end
110
+
91
111
  class GherkinDocument
92
112
 
93
113
  ##
@@ -1054,6 +1074,7 @@ module Cucumber
1054
1074
  message: hash[:message],
1055
1075
  success: hash[:success],
1056
1076
  timestamp: Timestamp.from_h(hash[:timestamp]),
1077
+ exception: Exception.from_h(hash[:exception]),
1057
1078
  )
1058
1079
  end
1059
1080
  end
@@ -1116,6 +1137,7 @@ module Cucumber
1116
1137
  duration: Duration.from_h(hash[:duration]),
1117
1138
  message: hash[:message],
1118
1139
  status: hash[:status],
1140
+ exception: Exception.from_h(hash[:exception]),
1119
1141
  )
1120
1142
  end
1121
1143
  end
@@ -41,9 +41,9 @@ module Cucumber
41
41
  # Content encoding is *not* determined by the media type, but rather by the type
42
42
  # of the object being attached:
43
43
  #
44
- # - string => IDENTITY
45
- # - byte array => BASE64
46
- # - stream => BASE64
44
+ # - string: IDENTITY
45
+ # - byte array: BASE64
46
+ # - stream: BASE64
47
47
 
48
48
  attr_reader :content_encoding
49
49
 
@@ -223,6 +223,34 @@ module Cucumber
223
223
  end
224
224
 
225
225
 
226
+ ##
227
+ # Represents the Exception message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
228
+ #
229
+ # A simplified representation of an exception
230
+ #
231
+
232
+ class Exception < ::Cucumber::Messages::Message
233
+
234
+ ##
235
+ # The type of the exception that caused this result. E.g. "Error" or "org.opentest4j.AssertionFailedError"
236
+
237
+ attr_reader :type
238
+
239
+ ##
240
+ # The message of exception that caused this result. E.g. expected: "a" but was: "b"
241
+
242
+ attr_reader :message
243
+
244
+ def initialize(
245
+ type: '',
246
+ message: nil
247
+ )
248
+ @type = type
249
+ @message = message
250
+ end
251
+ end
252
+
253
+
226
254
  ##
227
255
  # Represents the GherkinDocument message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
228
256
  #
@@ -1726,16 +1754,12 @@ module Cucumber
1726
1754
  class TestRunFinished < ::Cucumber::Messages::Message
1727
1755
 
1728
1756
  ##
1729
- # Error message. Can be a stack trace from a failed `BeforeAll` or `AfterAll`.
1730
- # If there are undefined parameter types, the message is simply
1731
- # "The following parameter type(s() are not defined: xxx, yyy".
1732
- # The independent `UndefinedParameterType` messages can be used to generate
1733
- # snippets for those parameter types.
1757
+ # An informative message about the test run. Typically additional information about failure, but not necessarily.
1734
1758
 
1735
1759
  attr_reader :message
1736
1760
 
1737
1761
  ##
1738
- # success = StrictModeEnabled ? (failed_count == 0 && ambiguous_count == 0 && undefined_count == 0 && pending_count == 0) : (failed_count == 0 && ambiguous_count == 0)
1762
+ # A test run is successful if all steps are either passed or skipped, all before/after hooks passed and no other exceptions where thrown.
1739
1763
 
1740
1764
  attr_reader :success
1741
1765
 
@@ -1744,14 +1768,21 @@ module Cucumber
1744
1768
 
1745
1769
  attr_reader :timestamp
1746
1770
 
1771
+ ##
1772
+ # Any exception thrown during the test run, if any. Does not include exceptions thrown while executing steps.
1773
+
1774
+ attr_reader :exception
1775
+
1747
1776
  def initialize(
1748
1777
  message: nil,
1749
1778
  success: false,
1750
- timestamp: Timestamp.new
1779
+ timestamp: Timestamp.new,
1780
+ exception: nil
1751
1781
  )
1752
1782
  @message = message
1753
1783
  @success = success
1754
1784
  @timestamp = timestamp
1785
+ @exception = exception
1755
1786
  end
1756
1787
  end
1757
1788
 
@@ -1814,18 +1845,28 @@ module Cucumber
1814
1845
 
1815
1846
  attr_reader :duration
1816
1847
 
1848
+ ##
1849
+ # An arbitrary bit of information that explains this result. This can be a stack trace of anything else.
1850
+
1817
1851
  attr_reader :message
1818
1852
 
1819
1853
  attr_reader :status
1820
1854
 
1855
+ ##
1856
+ # Exception thrown while executing this step, if any.
1857
+
1858
+ attr_reader :exception
1859
+
1821
1860
  def initialize(
1822
1861
  duration: Duration.new,
1823
1862
  message: nil,
1824
- status: TestStepResultStatus::UNKNOWN
1863
+ status: TestStepResultStatus::UNKNOWN,
1864
+ exception: nil
1825
1865
  )
1826
1866
  @duration = duration
1827
1867
  @message = message
1828
1868
  @status = status
1869
+ @exception = exception
1829
1870
  end
1830
1871
  end
1831
1872
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-messages
3
3
  version: !ruby/object:Gem::Version
4
- version: 20.0.0
4
+ version: 21.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-14 00:00:00.000000000 Z
11
+ date: 2022-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-compatibility-kit
@@ -127,7 +127,7 @@ requirements: []
127
127
  rubygems_version: 3.2.22
128
128
  signing_key:
129
129
  specification_version: 4
130
- summary: cucumber-messages-20.0.0
130
+ summary: cucumber-messages-21.0.1
131
131
  test_files:
132
132
  - spec/capture_warnings.rb
133
133
  - spec/cucumber/messages/acceptance_spec.rb