mutant 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Changelog.md +6 -0
- data/config/flay.yml +1 -1
- data/config/reek.yml +1 -0
- data/lib/mutant/version.rb +1 -1
- data/mutant-rspec.gemspec +1 -1
- data/spec/integration/mutant/rspec_spec.rb +40 -22
- data/spec/unit/mutant/cli_new_spec.rb +3 -3
- data/spec/unit/mutant/rspec/killer_spec.rb +2 -2
- data/test_app/Gemfile.rspec2 +4 -0
- data/test_app/Gemfile.rspec3 +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edacde6ada988b61110b578d2568903c5791c5bd
|
4
|
+
data.tar.gz: 66f1c39c340bade4fcc55b2b24cb838e787145d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 241299604cd937e1618f68d556544ddfc3580d7d52b9d263dc3aa0d1aa4d33de33fe7154392196c0685bbc9fd8e04143ba176ca3d73be95cdefee149b4b6a286
|
7
|
+
data.tar.gz: 1d4137de23eac2a0be3458dabe397f78c2b7c488e6531b52642324be3094f5076337baf4ee2c96300ef14bf774f33efdb66001008494f5674ddb7758ab20f898
|
data/.gitignore
CHANGED
data/Changelog.md
CHANGED
data/config/flay.yml
CHANGED
data/config/reek.yml
CHANGED
data/lib/mutant/version.rb
CHANGED
data/mutant-rspec.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.extra_rdoc_files = %w[TODO LICENSE]
|
19
19
|
|
20
20
|
gem.add_runtime_dependency('mutant', "~> #{gem.version}")
|
21
|
-
gem.add_runtime_dependency('rspec-core',
|
21
|
+
gem.add_runtime_dependency('rspec-core', '>= 2.14.1', '<= 3.0.0.beta2')
|
22
22
|
|
23
23
|
gem.add_development_dependency('bundler', '~> 1.3', '>= 1.3.5')
|
24
24
|
end
|
@@ -4,35 +4,53 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Mutant, 'rspec integration' do
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
let(:base_cmd) { "bundle exec mutant -I lib --require test_app --use rspec" }
|
8
|
+
|
9
|
+
shared_examples_for 'rspec integration' do
|
10
|
+
around do |example|
|
11
|
+
Bundler.with_clean_env do
|
12
|
+
Dir.chdir(TestApp.root) do
|
13
|
+
Kernel.system("bundle install --gemfile=#{gemfile}")
|
14
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
15
|
+
example.run
|
16
|
+
end
|
17
|
+
end
|
10
18
|
end
|
11
|
-
end
|
12
19
|
|
13
|
-
|
20
|
+
specify 'it allows to kill mutations' do
|
21
|
+
expect(Kernel.system("#{base_cmd} ::TestApp::Literal#string")).to be(true)
|
22
|
+
end
|
14
23
|
|
15
|
-
|
16
|
-
|
17
|
-
|
24
|
+
specify 'it allows to exclude mutations' do
|
25
|
+
cli = <<-CMD.split("\n").join(' ')
|
26
|
+
#{base_cmd}
|
27
|
+
::TestApp::Literal#string
|
28
|
+
::TestApp::Literal#uncovered_string
|
29
|
+
--ignore-subject ::TestApp::Literal#uncovered_string
|
30
|
+
CMD
|
31
|
+
expect(Kernel.system(cli)).to be(true)
|
32
|
+
end
|
18
33
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
34
|
+
specify 'fails to kill mutations when they are not covered' do
|
35
|
+
cli = "#{base_cmd} ::TestApp::Literal#uncovered_string"
|
36
|
+
expect(Kernel.system(cli)).to be(false)
|
37
|
+
end
|
38
|
+
|
39
|
+
specify 'fails when some mutations are not covered' do
|
40
|
+
cli = "#{base_cmd} ::TestApp::Literal"
|
41
|
+
expect(Kernel.system(cli)).to be(false)
|
42
|
+
end
|
27
43
|
end
|
28
44
|
|
29
|
-
|
30
|
-
|
31
|
-
|
45
|
+
context 'RSpec 2' do
|
46
|
+
let(:gemfile) { 'Gemfile.rspec2' }
|
47
|
+
|
48
|
+
it_behaves_like 'rspec integration'
|
32
49
|
end
|
33
50
|
|
34
|
-
|
35
|
-
|
36
|
-
|
51
|
+
context 'Rspec 3' do
|
52
|
+
let(:gemfile) { 'Gemfile.rspec3' }
|
53
|
+
|
54
|
+
it_behaves_like 'rspec integration'
|
37
55
|
end
|
38
56
|
end
|
@@ -13,9 +13,9 @@ end
|
|
13
13
|
shared_examples_for 'a cli parser' do
|
14
14
|
subject { cli.config }
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
it { expect(subject.strategy).to eql(expected_strategy) }
|
17
|
+
it { expect(subject.reporter).to eql(expected_reporter) }
|
18
|
+
it { expect(subject.matcher).to eql(expected_matcher) }
|
19
19
|
end
|
20
20
|
|
21
21
|
describe Mutant::CLI, '.new' do
|
@@ -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
|
-
|
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
|
-
|
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
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
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-
|
11
|
+
date: 2014-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -428,6 +428,8 @@ files:
|
|
428
428
|
- spec/unit/mutant_spec.rb
|
429
429
|
- test_app/.rspec
|
430
430
|
- test_app/Gemfile.devtools
|
431
|
+
- test_app/Gemfile.rspec2
|
432
|
+
- test_app/Gemfile.rspec3
|
431
433
|
- test_app/lib/test_app.rb
|
432
434
|
- test_app/lib/test_app/literal.rb
|
433
435
|
- test_app/spec/shared/command_method_behavior.rb
|