onlyoffice_tcm_helper 0.2.0 → 0.3.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: 5314bcff82aacd110912a3f45496c8e0a5f0933e01f2b7355e3ba19cceecf5f9
4
- data.tar.gz: af52601a9fb478d7c666b77dbf7b09dfcdb3ccbf56ea4f4bd8dfd5c83c053372
3
+ metadata.gz: 21f0cef80807ac242eddea36ebd1e23f92a1ea5d4544a236ca4439d3d0e8b952
4
+ data.tar.gz: 2cd487c7d384789b9cd8fc1ecd4818cd79182b6b9d6ab60d71c370dd1fb519a2
5
5
  SHA512:
6
- metadata.gz: eb18c3a30ad1f24711c834a8cd8134db353f1aa7e8635323ca3c476500559b27a9e2e26d5165c20bbed8113a2b9ec92f777f04cb29e42f82fc3b41dda81fdb5d
7
- data.tar.gz: 75ec1b4918b802443c454f1802593ef86c21fe66d076b03b1e731598c8b11727ad42aeb9c67fdc9560d34059bb79e4d23b382e72be9c016d798ee86ba11191b8
6
+ metadata.gz: 377d0932f0f048126bc8d9789e309f30d32ac98ee3e96aa84952e86be9bb5ade61fb9c1a42bb6eafeaf090a5c382699fdf81b10c6c2c93c231abc68b2dfd31a2
7
+ data.tar.gz: dc79a72f470ca0a4e37f550d7586060850375e316066537480f2eca51d887f1fac233a0072da7aa714ab441f300667e1be7349ea736c543f1b98ec013ad20f5f
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OnlyofficeTcmHelper
4
+ # module with methods for parsing test results
5
+ module PendingHelper
6
+ # Check if pending example passed
7
+ # This situation is incorrect - if pending is passing for some reason
8
+ # This pending comment should be removed and investigate
9
+ # @param [String] comment of example
10
+ # @return [Boolean]
11
+ def pending_passed?(comment)
12
+ comment.match?(/Expected pending.*to fail/)
13
+ end
14
+
15
+ # Get pending status by it's comment
16
+ # @param [String] comment of example
17
+ # @return [Symbol] `:failed` or `:pending`
18
+ def pending_status(comment)
19
+ if pending_passed?(comment)
20
+ :failed
21
+ else
22
+ :pending
23
+ end
24
+ end
25
+
26
+ # Handle pending information
27
+ # @param [RSpec::Core::Example] example to handle
28
+ # @retunr [Symbol] status of pending
29
+ def handle_pending(example)
30
+ @comment = example.execution_result.pending_message
31
+
32
+ pending_status(@comment)
33
+ end
34
+ end
35
+ end
@@ -5,7 +5,7 @@ class PseudoExampleAborted < PseudoExample
5
5
  # @return [String] exception string
6
6
  def exception
7
7
  "undefined local variable or method `tasdasdrue' "\
8
- 'for #<RSpec::ExampleGroups::OnlyofficeTcmHelper::'\
9
- 'StatusChecks:0x000000020b8400>'
8
+ 'for #<RSpec::ExampleGroups::OnlyofficeTcmHelper::'\
9
+ 'StatusChecks:0x000000020b8400>'
10
10
  end
11
11
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'sub_elements/executing_result_pending'
4
+
5
+ # class is describe object like RSpec::Core::Example with pending result
6
+ class PseudoExamplePendingButPassed < PseudoExample
7
+ def initialize(description)
8
+ super(description)
9
+ @execution_result = ExecutingResultPending.new(pending_message:
10
+ "Expected pending 'Fake failure' to fail. No error was raised.")
11
+ end
12
+
13
+ def pending?
14
+ true
15
+ end
16
+ end
@@ -4,8 +4,8 @@
4
4
  class ExecutingResultPending
5
5
  attr_reader :started_at, :pending_message
6
6
 
7
- def initialize
7
+ def initialize(pending_message: 'Pending exception')
8
8
  @started_at = Time.now
9
- @pending_message = 'Pending exception'
9
+ @pending_message = pending_message
10
10
  end
11
11
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module OnlyofficeTcmHelper
4
4
  # @return [String] version of gem
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'onlyoffice_tcm_helper/helpers/pending_helper'
3
4
  require 'onlyoffice_tcm_helper/helpers/rspec_helper'
4
5
  require 'onlyoffice_tcm_helper/helpers/time_helper'
5
6
  require 'onlyoffice_tcm_helper/version'
@@ -11,6 +12,7 @@ require 'json'
11
12
  module OnlyofficeTcmHelper
12
13
  # Class for generate data for result by RSpec::Core::Example
13
14
  class TcmHelper
15
+ include PendingHelper
14
16
  include TimeHelper
15
17
  include RspecHelper
16
18
  # @return [Symbol] one of status: passed, passed_2, failed, aborted, pending, service_unavailable, lpv
@@ -72,8 +74,7 @@ module OnlyofficeTcmHelper
72
74
  @comment = comment
73
75
  :failed
74
76
  elsif example.pending?
75
- @comment = example.execution_result.pending_message
76
- :pending
77
+ handle_pending(example)
77
78
  elsif result_is_passed?(example)
78
79
  @comment = "\nOk"
79
80
  :passed
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onlyoffice_tcm_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-01-13 00:00:00.000000000 Z
13
+ date: 2022-01-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: onlyoffice_file_helper
@@ -166,6 +166,7 @@ extensions: []
166
166
  extra_rdoc_files: []
167
167
  files:
168
168
  - lib/onlyoffice_tcm_helper.rb
169
+ - lib/onlyoffice_tcm_helper/helpers/pending_helper.rb
169
170
  - lib/onlyoffice_tcm_helper/helpers/rspec_helper.rb
170
171
  - lib/onlyoffice_tcm_helper/helpers/time_helper.rb
171
172
  - lib/onlyoffice_tcm_helper/models/pseudo_example.rb
@@ -175,6 +176,7 @@ files:
175
176
  - lib/onlyoffice_tcm_helper/models/pseudo_example_lpv.rb
176
177
  - lib/onlyoffice_tcm_helper/models/pseudo_example_passed.rb
177
178
  - lib/onlyoffice_tcm_helper/models/pseudo_example_pending.rb
179
+ - lib/onlyoffice_tcm_helper/models/pseudo_example_pending_but_passed.rb
178
180
  - lib/onlyoffice_tcm_helper/models/pseudo_example_service_unavailable.rb
179
181
  - lib/onlyoffice_tcm_helper/models/sub_elements/executing_result.rb
180
182
  - lib/onlyoffice_tcm_helper/models/sub_elements/executing_result_pending.rb
@@ -189,6 +191,7 @@ metadata:
189
191
  documentation_uri: https://www.rubydoc.info/gems/onlyoffice_tcm_helper
190
192
  homepage_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_tcm_helper
191
193
  source_code_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_tcm_helper
194
+ rubygems_mfa_required: 'true'
192
195
  post_install_message:
193
196
  rdoc_options: []
194
197
  require_paths:
@@ -204,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
207
  - !ruby/object:Gem::Version
205
208
  version: '0'
206
209
  requirements: []
207
- rubygems_version: 3.1.4
210
+ rubygems_version: 3.3.4
208
211
  signing_key:
209
212
  specification_version: 4
210
213
  summary: It is helper for work with tcm systems