cucumber-messages 20.0.0 → 21.0.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
  SHA256:
3
- metadata.gz: c3990dc466da3ed1fcfd89df413422c86fda8183a766ae660e0c8f25e72a4795
4
- data.tar.gz: 24308f5d7fc28df143bc0ab232ed8a9658220a4f844cde337c556b26375d61f6
3
+ metadata.gz: c69e3b13529cf0bf35e26e7c08b6edd544368fa2958c7565fc93760a512cce6a
4
+ data.tar.gz: 46d25f56f43f92aa3df93dd3d6f6809aedf59c404797dcb86fb07a4b0a347d83
5
5
  SHA512:
6
- metadata.gz: 0f8686679d4ab24f6c5c4c868d4e9d59dcdcde0743855b0332a2bdcd5374a447a85bdffec1630eb1eca37c18c10b624e6aa4243047810fe2dc26dcc6bd7625c2
7
- data.tar.gz: 3a67338f63c2fa966258f8265cad066502b663bd88b0b845e1232e04894f299b4022a449c848d6419b2a939b628fc990d82a2faa586955fb53b2adc00d9c9f55
6
+ metadata.gz: d21bb9cde318b627dad651e94b78c832dc330d23039f37928e269d5cb28716bb92a0f0ebf09d708f7583de98c70f508951059966cb2bfe8cac968403e1abcced
7
+ data.tar.gz: da96eb9001e92baee65f450cdabe648e399f1bb5d406fb68650f12b0a9a00e68f5b21b12c13d6b01de12544d0984895fed7f2c2d10178266e48b93ee5ef457c7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 20.0.0
1
+ 21.0.0
@@ -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
@@ -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.0
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.0
131
131
  test_files:
132
132
  - spec/capture_warnings.rb
133
133
  - spec/cucumber/messages/acceptance_spec.rb