mutant-rspec 0.5.0 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 304c77b0e3a947d35a7c2f7eb30dc41e7658e842
4
- data.tar.gz: 3fd8950a3f0019550a8583221974d65ed52c85cd
3
+ metadata.gz: 908a9f505d0063d97966ab94c257339583e3633f
4
+ data.tar.gz: 15a31463e9e7c6f129987bf4548e57cf430c3f40
5
5
  SHA512:
6
- metadata.gz: f7355ff3af44d76def593142b77aa3439d515d0f1228782c8d516b1f0645769504e508422547c2bcf7047ccc5a0a9daf6c49b518a00e61207ee02f600e2d3a8a
7
- data.tar.gz: 06114be8af316a7e89ab54a93ad297d040b5583ccf9bcba4cf02a9b6b68771ebc345fdda8fc8c44e78802859e84aef3fb230582df6183dc7af9a8bb287ace43d
6
+ metadata.gz: 1dc99f1d5ca8321e94c0d6cd924855aebc92f35beda3fbf902cac255615387e9df4895642897a1bb0653de8a874f94f229f9290212ba48d6689b3f54f9dafe42
7
+ data.tar.gz: 47f6bf02ffe9fca16ae1369d0c42f551d55bf31fd2b55ff1d4f43931c333aef314ea035b14af8894455ee6da054afc33eee9e15dfdc9bb06125554b7f8596f2d
@@ -32,8 +32,6 @@ module Mutant
32
32
  return false
33
33
  end
34
34
 
35
- reporter = RSpec::Core::Reporter.new
36
-
37
35
  example_groups.each do |group|
38
36
  return true unless group.run(reporter)
39
37
  end
@@ -90,6 +88,23 @@ module Mutant
90
88
  strategy.example_groups
91
89
  end
92
90
 
91
+ # Choose and memoize RSpec reporter
92
+ #
93
+ # @return [RSpec::Core::Reporter]
94
+ #
95
+ # @api private
96
+ #
97
+ def reporter
98
+ reporter_class = RSpec::Core::Reporter
99
+
100
+ if strategy.rspec2?
101
+ reporter_class.new
102
+ else
103
+ reporter_class.new(strategy.configuration)
104
+ end
105
+ end
106
+ memoize :reporter, freezer: :noop
107
+
93
108
  end # Killer
94
109
  end # Rspec
95
110
  end # Mutant
@@ -46,6 +46,20 @@ module Mutant
46
46
  world.example_groups
47
47
  end
48
48
 
49
+ # Detect RSpec 2
50
+ #
51
+ # @return [true]
52
+ # when RSpec 2
53
+ #
54
+ # @return [false]
55
+ # otherwise
56
+ #
57
+ # @api private
58
+ #
59
+ def rspec2?
60
+ RSpec::Core::Version::STRING.start_with?('2.')
61
+ end
62
+
49
63
  private
50
64
 
51
65
  # Return world
@@ -67,7 +81,7 @@ module Mutant
67
81
  #
68
82
  def options
69
83
  options = RSpec::Core::ConfigurationOptions.new(%w(--fail-fast spec))
70
- options.parse_options
84
+ options.parse_options if rspec2?
71
85
  options
72
86
  end
73
87
  memoize :options, freezer: :noop
@@ -42,7 +42,7 @@ describe Mutant::Rspec::Killer, '.new' do
42
42
  context 'when run exits zero' do
43
43
  let(:exit_status) { 0 }
44
44
 
45
- its(:killed?) { should be(false) }
45
+ it { expect(subject.killed?).to be(false) }
46
46
 
47
47
  it { should be_a(described_class) }
48
48
  end
@@ -50,7 +50,7 @@ describe Mutant::Rspec::Killer, '.new' do
50
50
  context 'when run exits nonzero' do
51
51
  let(:exit_status) { 1 }
52
52
 
53
- its(:killed?) { should be(true) }
53
+ it { expect(subject.killed?).to be(true) }
54
54
 
55
55
  it { should be_a(described_class) }
56
56
  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.0
4
+ version: 0.5.3
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-03-02 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mutant
@@ -16,28 +16,34 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: 0.5.3
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.0
26
+ version: 0.5.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.14.1
34
+ - - <=
35
+ - !ruby/object:Gem::Version
36
+ version: 3.0.0.beta2
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - ~>
41
+ - - '>='
39
42
  - !ruby/object:Gem::Version
40
43
  version: 2.14.1
44
+ - - <=
45
+ - !ruby/object:Gem::Version
46
+ version: 3.0.0.beta2
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement