mutant-rspec 0.11.28 → 0.11.30

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: 9c422deda8456db50da04c1070390db85c7028bd357c9d50eba82f8f2ccfe921
4
- data.tar.gz: 23a1d84a9a983b1698940ae1e0d25fdd32b123c0ffce5ac75e4c5e9f7fdc7ed9
3
+ metadata.gz: cd2f14727ab0b71c1dbc7f1d55bba07742d256ff7c6819a872292ceb6714a8f8
4
+ data.tar.gz: 0dce3f71c47e3cb7ec712ac8f833589d029ecd72ba45d56307e611f3db4d83b4
5
5
  SHA512:
6
- metadata.gz: 1a2dd9e2de4991485e8f9c1832800c5e1c2aeafc0e9b480b7794196dca621329542faf1c4ea5c29861109d44222c3ce469293747951e9e1a7ef4ed18683d4f72
7
- data.tar.gz: 0a55ad1f85341a80527f9649aa543343377a03cc62c0f7555e9bf3b147698d5568b89817471a62984584521b633de2a137cec14bb3dfda64fb87d0d2cf2dab85
6
+ metadata.gz: 1f232c3c34cffd085e08545b825112038f34e88b65bf64dd2a0cc93f51c4d6baba1d97ccd7f27ba93f0dbc498b2bc76f11e1490e23f40491b6ff051eb72894ab
7
+ data.tar.gz: 9ba608b571465170fdc62d421b0565b3468d3e9aa3f99f1fb7bd39510086720b85202abc37eaf847ddaaf726f57f02c8ef517f877088498d2bf936402f177923
@@ -19,8 +19,9 @@ module Mutant
19
19
  # * location
20
20
  # Is NOT enough. It would not be unique. So we add an "example index"
21
21
  # for unique reference.
22
+ #
23
+ # rubocop:disable Metrics/ClassLength
22
24
  class Rspec < self
23
-
24
25
  ALL_EXPRESSION = Expression::Namespace::Recursive.new(scope_name: nil)
25
26
  EXPRESSION_CANDIDATE = /\A([^ ]+)(?: )?/
26
27
  EXIT_SUCCESS = 0
@@ -29,6 +30,11 @@ module Mutant
29
30
 
30
31
  private_constant(*constants(false))
31
32
 
33
+ def freeze
34
+ super() if @setup_elapsed
35
+ self
36
+ end
37
+
32
38
  # Initialize rspec integration
33
39
  #
34
40
  # @return [undefined]
@@ -42,10 +48,15 @@ module Mutant
42
48
  #
43
49
  # @return [self]
44
50
  def setup
45
- @runner.setup($stderr, $stdout)
46
- example_group_map
51
+ @setup_elapsed = timer.elapsed do
52
+ @runner.setup(world.stderr, world.stdout)
53
+ fail 'Rspec setup failure' if RSpec.world.respond_to?(:rspec_is_quitting) && RSpec.world.rspec_is_quitting
54
+ example_group_map
55
+ end
56
+ @runner.configuration.force(color_mode: :on)
57
+ @runner.configuration.reporter
47
58
  reset_examples
48
- self
59
+ freeze
49
60
  end
50
61
  memoize :setup
51
62
 
@@ -54,15 +65,24 @@ module Mutant
54
65
  # @param [Enumerable<Mutant::Test>] tests
55
66
  #
56
67
  # @return [Result::Test]
68
+ #
69
+ # rubocop:disable Metrics/AbcSize
70
+ # rubocop:disable Metrics/MethodLength
57
71
  def call(tests)
72
+ reset_examples
58
73
  setup_examples(tests.map(&all_tests_index))
74
+ @runner.configuration.start_time = world.time.now - @setup_elapsed
59
75
  start = timer.now
60
76
  passed = @runner.run_specs(@rspec_world.ordered_example_groups).equal?(EXIT_SUCCESS)
77
+ @runner.configuration.reset_reporter
61
78
  Result::Test.new(
79
+ output: '',
62
80
  passed: passed,
63
81
  runtime: timer.now - start
64
82
  )
65
83
  end
84
+ # rubocop:enable Metrics/AbcSize
85
+ # rubocop:enable Metrics/MethodLength
66
86
 
67
87
  # All tests
68
88
  #
@@ -149,5 +169,6 @@ module Mutant
149
169
  @rspec_world.example_groups.flat_map(&:descendants).flat_map(&:examples)
150
170
  end
151
171
  end # Rspec
172
+ # rubocop:enable Metrics/ClassLength
152
173
  end # Integration
153
174
  end # Mutant
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.28
4
+ version: 0.11.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-09 00:00:00.000000000 Z
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mutant
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.11.28
19
+ version: 0.11.30
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.11.28
26
+ version: 0.11.30
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec-core
29
29
  requirement: !ruby/object:Gem::Requirement