semaphore_test_boosters 2.2.1 → 2.2.2

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
  SHA1:
3
- metadata.gz: 388911573a152f707678f327a58323cf01344cfb
4
- data.tar.gz: 3efd4696b35774a515c6bf6768c586cf823301b7
3
+ metadata.gz: 590c85d7b12cd31c902565d266796ee97076a430
4
+ data.tar.gz: 19731cd1002e9bda080fad24f1db08b13cf05a57
5
5
  SHA512:
6
- metadata.gz: 93235768cb23b4d9ad8ef939bfef9cbfc2ce56c5c5f845cba8e4cabb836c0e0004696ada04bca7fa67706f9f34ecb009f51d01e73ae974435a49b8ee2d7c95d4
7
- data.tar.gz: e59008f804a3c9d4060a8bf74a378567f03712150809d79a8ebad4f99cca62724b4cd318267e5fed473d0e2f2e137ae8202a46c365c99f7192eff74c51ff60e0
6
+ metadata.gz: 864c78cd9145390f046a196f19c8e6be30217384829b800ecdfb79b57a13381c9acda62f3650415993fac3835017487f145f1b3c5eb37f4b75e4db95708b6a54
7
+ data.tar.gz: 02ebed353437dd645b1f500c49bf24c7d366da95c80dc7b662df3fb8cc3d6cfdddbc68df9467affa030ca5856f3a3435c3210fc7cd3d1e605376e61e459830f4
@@ -1,3 +1,3 @@
1
1
  module TestBoosters
2
- VERSION = "2.2.1".freeze
2
+ VERSION = "2.2.2".freeze
3
3
  end
@@ -35,16 +35,21 @@ class SemaphoreFormatter < RSpec::Core::Formatters::BaseFormatter
35
35
  end
36
36
 
37
37
  def file_path(example)
38
- # In case of a shared_example
39
- # example[:file_path] returns the path of the shared_example file
38
+ # For shared examples 'example.file_path' returns the path of the shared example file.
39
+ # This is not optinal for our use case because we can't estimate the duration of the
40
+ # original spec file.
40
41
  #
41
- # We are interested in the duration of the file from which the shared_example was called instead.
42
- #
43
- # We can get this infor from `example.id`.
44
- #
45
- # It has the following format: `./spec/models/analysis_spec.rb[1:17:1:1:1]`
46
- # We are droping the angle brackets at the end.
42
+ # To resolve this, we use `example.metadata[:example_group]` that contains the correct
43
+ # file path for both shared examples and regular tests
44
+
45
+ find_example_group_root_path(example.metadata[:example_group])
46
+ end
47
47
 
48
- example.id.gsub(/\[.*\]$/, "")
48
+ def find_example_group_root_path(example_group)
49
+ if example_group.has_key?(:parent_example_group)
50
+ find_example_group_root_path(example_group[:parent_example_group])
51
+ else
52
+ example_group[:file_path]
53
+ end
49
54
  end
50
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore_test_boosters
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Developers at Rendered Text
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-25 00:00:00.000000000 Z
11
+ date: 2017-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semaphore_cucumber_booster_config