mutant-rspec 0.5.24 → 0.5.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mutant/integration/rspec.rb +24 -12
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c097ff8dc45b860c325bdaca5957506af0c4991
|
4
|
+
data.tar.gz: c140fb77ec974c3f4f400d8c2632b27745848ed4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d243770344ae1dfca21f0cb6988ec4ae2887ecd1d96a4ec24c9d90a6a210c08ae985c9ef8685e560b5ac7d0551451cfb8923274f3ffc9c342de0ae4a5874f6e3
|
7
|
+
data.tar.gz: 8950117e07f4cfaa06934edb6e1362622a46e7f350953d836a96cee3573bff89d8c3574b30e0487d600fa0221fe8c65835a5dc5eeb051ec54b91073b1607e0b1
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
require 'rspec/core'
|
3
|
-
require 'rspec/core/version'
|
4
|
-
|
5
3
|
require 'rspec/core/formatters/base_text_formatter'
|
6
4
|
|
7
5
|
module Mutant
|
@@ -27,22 +25,31 @@ module Mutant
|
|
27
25
|
#
|
28
26
|
# @param [Rspec::Test] test
|
29
27
|
#
|
30
|
-
# @return [Test::
|
28
|
+
# @return [Test::Result]
|
31
29
|
#
|
32
30
|
# @api private
|
33
31
|
#
|
32
|
+
# rubocop:disable MethodLength
|
33
|
+
#
|
34
34
|
def run(test)
|
35
35
|
output = StringIO.new
|
36
|
-
|
36
|
+
failed = false
|
37
|
+
start = Time.now
|
37
38
|
reporter = new_reporter(output)
|
38
39
|
reporter.report(1) do
|
39
|
-
|
40
|
+
example_group_index.fetch(test.expression.syntax).each do |example_group|
|
41
|
+
next if example_group.run(reporter)
|
42
|
+
failed = true
|
43
|
+
break
|
44
|
+
end
|
40
45
|
end
|
41
46
|
output.rewind
|
42
|
-
Test
|
43
|
-
test:
|
44
|
-
output:
|
45
|
-
|
47
|
+
Result::Test.new(
|
48
|
+
test: self,
|
49
|
+
output: output.read,
|
50
|
+
runtime: Time.now - start,
|
51
|
+
mutation: nil,
|
52
|
+
passed: !failed
|
46
53
|
)
|
47
54
|
end
|
48
55
|
|
@@ -70,9 +77,14 @@ module Mutant
|
|
70
77
|
# @api private
|
71
78
|
#
|
72
79
|
def example_group_index
|
73
|
-
Hash
|
74
|
-
|
75
|
-
|
80
|
+
index = Hash.new { |hash, key| hash[key] = [] }
|
81
|
+
|
82
|
+
RSpec.world.example_groups.flat_map(&:descendants).each do |example_group|
|
83
|
+
full_description = full_description(example_group)
|
84
|
+
index[full_description] << example_group
|
85
|
+
end
|
86
|
+
|
87
|
+
index
|
76
88
|
end
|
77
89
|
memoize :example_group_index
|
78
90
|
|
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.5.
|
4
|
+
version: 0.5.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-07 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.5.
|
19
|
+
version: 0.5.25
|
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.5.
|
26
|
+
version: 0.5.25
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec-core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|