mutant-rspec 0.5.26 → 0.6.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
  SHA1:
3
- metadata.gz: bd4d97e057ca604728d00896d54a1f7c1da8f99c
4
- data.tar.gz: e93baeb5726baf5ae160f3b9df2dafc41d70a02d
3
+ metadata.gz: ed85a3cccedbae0b629ccbd1d1d9cb02f5d4f599
4
+ data.tar.gz: c8d584e654120aa2eda22bb7b399c8f9625a9674
5
5
  SHA512:
6
- metadata.gz: 1ff592edf3a8561d86f994d92cd754a06a178a3aac1e367202209e9a8a27ef2a2c48d67a6935baf7a20aafd1ad5c84e24c3608df055c82cd79cc129bccce2aa8
7
- data.tar.gz: e5d8e44046ebb484c070d5bb53db59d84294ac5cb4339b89f8e73e797959623072fd9ee38af03f145d08cc53a889650da5a1a86677d4d95e83cb13e301a66ea1
6
+ metadata.gz: e862760c664e8dfc7ba2452f033ddd86aa7ccd5f17faec9999528366609a90492bfb3602ca2bd08f4dc35e0f46915a7c10186e5ea130a2eea5d8678155dbbdb0
7
+ data.tar.gz: f79cfdcdab2db1f60e91d6c36cb608f8373a4942f834f746f6c02b750ff7aaaf0aee45a2bfeca8f9b4f9897f89e7a74aea441ee78f90d17c783d3d8051d2fbf4
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  require 'rspec/core'
3
2
  require 'rspec/core/formatters/base_text_formatter'
4
3
 
@@ -8,6 +7,24 @@ module Mutant
8
7
  class Rspec < self
9
8
  include AbstractType
10
9
 
10
+ register 'rspec'
11
+
12
+ RSPEC_2_VERSION_PREFIX = '2.'.freeze
13
+
14
+ # Return integration compatible to currently loaded rspec
15
+ #
16
+ # @return [Integration]
17
+ #
18
+ # @api private
19
+ #
20
+ def self.build
21
+ if RSpec::Core::Version::STRING.start_with?(RSPEC_2_VERSION_PREFIX)
22
+ Rspec2.new
23
+ else
24
+ Rspec3.new
25
+ end
26
+ end
27
+
11
28
  # Setup rspec integration
12
29
  #
13
30
  # @return [self]
@@ -45,10 +62,10 @@ module Mutant
45
62
  end
46
63
  output.rewind
47
64
  Result::Test.new(
48
- test: self,
65
+ test: nil,
66
+ mutation: nil,
49
67
  output: output.read,
50
68
  runtime: Time.now - start,
51
- mutation: nil,
52
69
  passed: !failed
53
70
  )
54
71
  end
@@ -110,14 +127,86 @@ module Mutant
110
127
  end
111
128
  memoize :options, freezer: :noop
112
129
 
130
+ # Rspec2 integration
131
+ class Rspec2 < self
132
+
133
+ register 'rspec'
134
+
135
+ private
136
+
137
+ # Return options
138
+ #
139
+ # @return [RSpec::Core::ConfigurationOptions]
140
+ #
141
+ # @api private
142
+ #
143
+ def options
144
+ super.tap(&:parse_options)
145
+ end
146
+
147
+ # Return full description of example group
148
+ #
149
+ # @param [RSpec::Core::ExampleGroup] example_group
150
+ #
151
+ # @return [String]
152
+ #
153
+ # @api private
154
+ #
155
+ def full_description(example_group)
156
+ example_group.metadata.fetch(:example_group).fetch(:full_description)
157
+ end
158
+
159
+ # Return new reporter
160
+ #
161
+ # @param [StringIO] output
162
+ #
163
+ # @return [RSpec::Core::Reporter]
164
+ #
165
+ # @api private
166
+ #
167
+ def new_reporter(output)
168
+ formatter = RSpec::Core::Formatters::BaseTextFormatter.new(output)
169
+
170
+ RSpec::Core::Reporter.new(formatter)
171
+ end
172
+
173
+ end # Rspec2
174
+
175
+ # Rspec 3 integration
176
+ class Rspec3 < self
177
+
178
+ private
179
+
180
+ # Return full description for example group
181
+ #
182
+ # @param [RSpec::Core::ExampleGroup] example_group
183
+ #
184
+ # @return [String]
185
+ #
186
+ # @api private
187
+ #
188
+ def full_description(example_group)
189
+ example_group.metadata.fetch(:full_description)
190
+ end
191
+
192
+ # Return new reporter
193
+ #
194
+ # @param [StringIO] output
195
+ #
196
+ # @return [RSpec::Core::Reporter]
197
+ #
198
+ # @api private
199
+ #
200
+ def new_reporter(output)
201
+ formatter = RSpec::Core::Formatters::BaseTextFormatter.new(output)
202
+ notifications = RSpec::Core::Formatters::Loader.allocate.send(:notifications_for, formatter.class)
203
+
204
+ RSpec::Core::Reporter.new(configuration).tap do |reporter|
205
+ reporter.register_listener(formatter, *notifications)
206
+ end
207
+ end
208
+
209
+ end # Rspec3
113
210
  end # Rspec
114
211
  end # Integration
115
212
  end # Mutant
116
-
117
- RSPEC_2_VERSION_PREFIX = '2.'.freeze
118
-
119
- if RSpec::Core::Version::STRING.start_with?(RSPEC_2_VERSION_PREFIX)
120
- require 'mutant/integration/rspec2'
121
- else
122
- require 'mutant/integration/rspec3'
123
- end
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.26
4
+ version: 0.6.0
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-07-08 00:00:00.000000000 Z
11
+ date: 2014-08-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.5.26
19
+ version: 0.6.0
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
26
+ version: 0.6.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec-core
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -31,9 +31,9 @@ dependencies:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.14.1
34
- - - "<="
34
+ - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: 3.0.0
36
+ version: 3.1.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -41,9 +41,9 @@ dependencies:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: 2.14.1
44
- - - "<="
44
+ - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: 3.0.0
46
+ version: 3.1.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -76,8 +76,6 @@ files:
76
76
  - LICENSE
77
77
  - TODO
78
78
  - lib/mutant/integration/rspec.rb
79
- - lib/mutant/integration/rspec2.rb
80
- - lib/mutant/integration/rspec3.rb
81
79
  homepage: https://github.com/mbj/mutant
82
80
  licenses:
83
81
  - MIT
@@ -1,48 +0,0 @@
1
- module Mutant
2
- class Integration
3
- # Rspec2 integration
4
- class Rspec2 < Rspec
5
-
6
- register 'rspec'
7
-
8
- private
9
-
10
- # Return options
11
- #
12
- # @return [RSpec::Core::ConfigurationOptions]
13
- #
14
- # @api private
15
- #
16
- def options
17
- super.tap(&:parse_options)
18
- end
19
-
20
- # Return full description of example group
21
- #
22
- # @param [RSpec::Core::ExampleGroup] example_group
23
- #
24
- # @return [String]
25
- #
26
- # @api private
27
- #
28
- def full_description(example_group)
29
- example_group.metadata.fetch(:example_group).fetch(:full_description)
30
- end
31
-
32
- # Return new reporter
33
- #
34
- # @param [StringIO] output
35
- #
36
- # @return [RSpec::Core::Reporter]
37
- #
38
- # @api private
39
- #
40
- def new_reporter(output)
41
- formatter = RSpec::Core::Formatters::BaseTextFormatter.new(output)
42
-
43
- RSpec::Core::Reporter.new(formatter)
44
- end
45
-
46
- end # Rspec2
47
- end # Integration
48
- end # Mutant
@@ -1,41 +0,0 @@
1
- module Mutant
2
- class Integration
3
- # Rspec3 integration
4
- class Rspec3 < Rspec
5
-
6
- register 'rspec'
7
-
8
- private
9
-
10
- # Return full description for example group
11
- #
12
- # @param [RSpec::Core::ExampleGroup] example_group
13
- #
14
- # @return [String]
15
- #
16
- # @api private
17
- #
18
- def full_description(example_group)
19
- example_group.metadata.fetch(:full_description)
20
- end
21
-
22
- # Return new reporter
23
- #
24
- # @param [StringIO] output
25
- #
26
- # @return [RSpec::Core::Reporter]
27
- #
28
- # @api private
29
- #
30
- def new_reporter(output)
31
- formatter = RSpec::Core::Formatters::BaseTextFormatter.new(output)
32
- notifications = RSpec::Core::Formatters::Loader.allocate.send(:notifications_for, formatter.class)
33
-
34
- RSpec::Core::Reporter.new(configuration).tap do |reporter|
35
- reporter.register_listener(formatter, *notifications)
36
- end
37
- end
38
-
39
- end # Rspec3
40
- end # Integration
41
- end # Mutant