mutant-rspec 0.11.28 → 0.11.29

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: 47cf16579652a617b792748d4792f2f4dbe08b3579dbaa6f1991941b84301ac6
4
+ data.tar.gz: 973051e294a0df162bea944afe5f7a781c713d8003965f562748d515e9e41686
5
5
  SHA512:
6
- metadata.gz: 1a2dd9e2de4991485e8f9c1832800c5e1c2aeafc0e9b480b7794196dca621329542faf1c4ea5c29861109d44222c3ce469293747951e9e1a7ef4ed18683d4f72
7
- data.tar.gz: 0a55ad1f85341a80527f9649aa543343377a03cc62c0f7555e9bf3b147698d5568b89817471a62984584521b633de2a137cec14bb3dfda64fb87d0d2cf2dab85
6
+ metadata.gz: dd7601a4c2129faceca006b94917a270f52d0ff671962c3896b7f58a87ad162062e5042cc8e86c833317fa4985107fd979c160ed7f4495339e32b37a9bd8fa4d
7
+ data.tar.gz: 226c7de3cbd7668e20605ecc1ca718c457df78f3cc34e2098a6500c84142389ccacc3cea97c165d7a84dcbb2844b1cbab6014fa4bd24c6990badadc52c17a7ae
@@ -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.29
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-09 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.29
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.29
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec-core
29
29
  requirement: !ruby/object:Gem::Requirement