mutest 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +62 -0
- data/README.md +4 -0
- data/lib/mutest.rb +3 -0
- data/lib/mutest/cli.rb +1 -1
- data/lib/mutest/config.rb +1 -0
- data/lib/mutest/integration.rb +0 -24
- data/lib/mutest/requirer.rb +6 -0
- data/lib/mutest/version.rb +1 -1
- data/spec/unit/mutest/cli_spec.rb +15 -3
- data/spec/unit/mutest/integration_spec.rb +4 -4
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28ad889f38011616ab297533e38652fd025f3b70
|
4
|
+
data.tar.gz: 28e755a956d3f328e5374bb35ab65664ff479fd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28a36e5aec3ee2931dfcdef9634e167c46aa157e97662c91ab6f7e84ec7c92d984dc89cacbd098cd990c6fdbbbd0d54572b161ce671752f9a793f8a21bfee721
|
7
|
+
data.tar.gz: 49fb9c67f4faea1835d4cc97d7c20193c1dc84b29903781e45894b2820b528cfba91742be9d60fd6a6528265c1a9cbdaa4ff07d9e2fb28a702d90fd2720a2580
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# Change log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
6
|
+
|
7
|
+
## [Master (Unreleased)]
|
8
|
+
|
9
|
+
## [0.0.5] - 2017-03-04
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Now `mutest` can be run without being in the bundle. [[#46](https://github.com/backus/mutest/pull/46/files) ([@mvz][])]
|
14
|
+
|
15
|
+
## [0.0.4] - 2017-02-16
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
|
19
|
+
- Restarg body mutations that were being emitted for unused restargs [[#44](https://github.com/backus/mutest/pull/44/files) ([@dgollahon][])]
|
20
|
+
|
21
|
+
### Removed
|
22
|
+
|
23
|
+
- Less strict relational operator mutations (`<` -> `<=`; `>` -> `>=`) [[#47](https://github.com/backus/mutest/pull/47/files) ([@backus][])]
|
24
|
+
- Unused `ffi` dependency [[#40](https://github.com/backus/mutest/pull/40/files) ([@mvz][])]
|
25
|
+
|
26
|
+
## [0.0.3] - 2017-01-31
|
27
|
+
|
28
|
+
### Fixed
|
29
|
+
|
30
|
+
- Errors on AST nodes without locations [[#32](https://github.com/backus/mutest/pull/32/files) ([@backus][])]
|
31
|
+
|
32
|
+
## [0.0.2] - 2017-01-30
|
33
|
+
|
34
|
+
First proper RubyGems release
|
35
|
+
|
36
|
+
### Added
|
37
|
+
|
38
|
+
- Hash hint mutation (`def foo(opts); end` -> `def foo(**opts); end`) [[#24](https://github.com/backus/mutest/pull/24/files) ([@dgollahon][])]
|
39
|
+
- Unused restarg mutations (`def(*args); end` -> `def(*_args); end`; `def(**opts); end` -> `def(**_opts); end` [[#18](https://github.com/backus/mutest/pull/18/files) ([@dgollahon][])]
|
40
|
+
- Select/Reject mutations (`a.select(&b)` -> `a.reject(&b)`, `a.reject(&b)` -> `a.select(&b)`) [[#15](https://github.com/backus/mutest/pull/15/files) ([@dgollahon][])]
|
41
|
+
- Array to array literal mutation (`Array(a)` -> `[a]`) [[#14](https://github.com/backus/mutest/pull/14/files) ([@dgollahon][])]
|
42
|
+
- One-or-more to two-or-more quantifier mutations (`/a+/` -> `/a{2,}/`; `/a+?/` -> `/a{2,}?/`; `/a++/` -> `/a{2,}+/`) [[#13](https://github.com/backus/mutest/pull/13/files) ([@dgollahon][])]
|
43
|
+
- Reluctant and possessive zero-or-more to one-or-more quantifier mutations (`/a*?/` -> `/a+?/`; `/a+?/` -> `/a++/`) [[#11](https://github.com/backus/mutest/pull/11/files) ([@dgollahon][])]
|
44
|
+
- Grep/Grepv mutations (`a.grep(b)` -> `a.grep_v(b)`; `a.grep_v(b)` -> `a.grep(b)`) [[#10](https://github.com/backus/mutest/pull/10/files) ([@dgollahon][])]
|
45
|
+
- Threequals to kind_of mutation (`a === b` -> `a.kind_of?(b)`) [[#9](https://github.com/backus/mutest/pull/9) ([@dgollahon][])]
|
46
|
+
- Method body to super mutation (`def foo; body; end` -> `def foo; super; end`) [[#8](https://github.com/backus/mutest/pull/8/files) ([@dgollahon][])]
|
47
|
+
- Mutest disables (`# mutest:disable`) [[#6](https://github.com/backus/mutest/pull/6/files) ([@backus][])]
|
48
|
+
- Compound assignment mutations (`a += b` -> `a + b`, `a = b`) [[#2](https://github.com/backus/mutest/pull/2/files) ([@dgollahon][])]
|
49
|
+
|
50
|
+
<!-- Version diffs -->
|
51
|
+
|
52
|
+
[Master (Unreleased)]: https://github.com/backus/mutest/compare/v0.0.5...HEAD
|
53
|
+
[0.0.5]: https://github.com/backus/mutest/compare/v0.0.4...v0.0.5
|
54
|
+
[0.0.4]: https://github.com/backus/mutest/compare/v0.0.3...v0.0.4
|
55
|
+
[0.0.3]: https://github.com/backus/mutest/compare/v0.0.2...v0.0.3
|
56
|
+
[0.0.2]: https://github.com/backus/mutest/compare/7a50870929325127db8578ade9c8656f356131ba...v0.0.2
|
57
|
+
|
58
|
+
<!-- Contributors -->
|
59
|
+
|
60
|
+
[@backus]: https://github.com/backus
|
61
|
+
[@dgollahon]: https://github.com/dgollahon
|
62
|
+
[@mvz]: https://github.com/mvz
|
data/README.md
CHANGED
@@ -3,6 +3,10 @@ mutest
|
|
3
3
|
|
4
4
|
This is a fork of a popular open source mutation testing tool for Ruby. Not ready for prime time!
|
5
5
|
|
6
|
+
## Changes
|
7
|
+
|
8
|
+
For updates to the project, check out the [CHANGELOG](CHANGELOG.md)!
|
9
|
+
|
6
10
|
## Credit
|
7
11
|
|
8
12
|
* Markus Schirp did an amazing job on [mutant](mbj/mutant) which this fork is based on.
|
data/lib/mutest.rb
CHANGED
@@ -179,6 +179,7 @@ require 'mutest/expression/methods'
|
|
179
179
|
require 'mutest/expression/namespace'
|
180
180
|
require 'mutest/test'
|
181
181
|
require 'mutest/integration'
|
182
|
+
require 'mutest/integration/null'
|
182
183
|
require 'mutest/selector'
|
183
184
|
require 'mutest/selector/expression'
|
184
185
|
require 'mutest/config'
|
@@ -206,6 +207,7 @@ require 'mutest/reporter/cli/printer/test_result'
|
|
206
207
|
require 'mutest/reporter/cli/tput'
|
207
208
|
require 'mutest/reporter/cli/format'
|
208
209
|
require 'mutest/repository'
|
210
|
+
require 'mutest/requirer'
|
209
211
|
require 'mutest/zombifier'
|
210
212
|
|
211
213
|
module Mutest
|
@@ -230,6 +232,7 @@ module Mutest
|
|
230
232
|
process: Process
|
231
233
|
),
|
232
234
|
jobs: ::Parallel.processor_count,
|
235
|
+
requirer: Requirer.new,
|
233
236
|
kernel: Kernel,
|
234
237
|
load_path: $LOAD_PATH,
|
235
238
|
matcher: Matcher::Config::DEFAULT,
|
data/lib/mutest/cli.rb
CHANGED
@@ -99,7 +99,7 @@ module Mutest
|
|
99
99
|
#
|
100
100
|
# @return [undefined]
|
101
101
|
def setup_integration(name)
|
102
|
-
with(integration: Integration.setup(config.
|
102
|
+
with(integration: Integration.setup(config.requirer, name))
|
103
103
|
rescue LoadError
|
104
104
|
raise Error, "Could not load integration #{name.inspect} (you may want to try installing the gem mutest-#{name})"
|
105
105
|
end
|
data/lib/mutest/config.rb
CHANGED
data/lib/mutest/integration.rb
CHANGED
@@ -47,29 +47,5 @@ module Mutest
|
|
47
47
|
def expression_parser
|
48
48
|
config.expression_parser
|
49
49
|
end
|
50
|
-
|
51
|
-
# Null integration that never kills a mutation
|
52
|
-
class Null < self
|
53
|
-
# Available tests for integration
|
54
|
-
#
|
55
|
-
# @return [Enumerable<Test>]
|
56
|
-
def all_tests
|
57
|
-
EMPTY_ARRAY
|
58
|
-
end
|
59
|
-
|
60
|
-
# Run a collection of tests
|
61
|
-
#
|
62
|
-
# @param [Enumerable<Mutest::Test>] tests
|
63
|
-
#
|
64
|
-
# @return [Result::Test]
|
65
|
-
def call(tests)
|
66
|
-
Result::Test.new(
|
67
|
-
output: '',
|
68
|
-
passed: true,
|
69
|
-
runtime: 0.0,
|
70
|
-
tests: tests
|
71
|
-
)
|
72
|
-
end
|
73
|
-
end # Null
|
74
50
|
end # Integration
|
75
51
|
end # Mutest
|
data/lib/mutest/version.rb
CHANGED
@@ -137,18 +137,30 @@ Options:
|
|
137
137
|
end
|
138
138
|
|
139
139
|
context 'with use flag' do
|
140
|
-
context 'when integration
|
140
|
+
context 'when using the existing integration with rspec' do
|
141
141
|
let(:flags) { %w[--use rspec] }
|
142
|
+
let(:expected_integration) { Mutest::Integration::Rspec }
|
142
143
|
|
143
144
|
before do
|
144
|
-
expect(
|
145
|
+
expect(Mutest::Config::DEFAULT.requirer).to receive(:require)
|
145
146
|
.with('mutest/integration/rspec')
|
146
147
|
.and_call_original
|
147
148
|
end
|
148
149
|
|
149
150
|
it_should_behave_like 'a cli parser'
|
151
|
+
end
|
150
152
|
|
151
|
-
|
153
|
+
context 'when specifying the default null integration explicitely' do
|
154
|
+
let(:flags) { %w[--use null] }
|
155
|
+
let(:expected_integration) { Mutest::Integration::Null }
|
156
|
+
|
157
|
+
before do
|
158
|
+
expect(Mutest::Config::DEFAULT.requirer).to receive(:require)
|
159
|
+
.with('mutest/integration/null')
|
160
|
+
.and_call_original
|
161
|
+
end
|
162
|
+
|
163
|
+
it_should_behave_like 'a cli parser'
|
152
164
|
end
|
153
165
|
|
154
166
|
context 'when integration does NOT exist' do
|
@@ -11,13 +11,13 @@ RSpec.describe Mutest::Integration do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
describe '.setup' do
|
14
|
-
subject { described_class.setup(
|
14
|
+
subject { described_class.setup(requirer, name) }
|
15
15
|
|
16
|
-
let(:name)
|
17
|
-
let(:
|
16
|
+
let(:name) { 'null' }
|
17
|
+
let(:requirer) { Mutest::Requirer.new }
|
18
18
|
|
19
19
|
before do
|
20
|
-
expect(
|
20
|
+
expect(requirer).to receive(:require)
|
21
21
|
.with('mutest/integration/null')
|
22
22
|
end
|
23
23
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Gollahon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: parser
|
@@ -284,6 +284,7 @@ files:
|
|
284
284
|
- ".gitattributes"
|
285
285
|
- ".gitignore"
|
286
286
|
- ".rspec"
|
287
|
+
- CHANGELOG.md
|
287
288
|
- Gemfile
|
288
289
|
- Gemfile.lock
|
289
290
|
- Gemfile.shared
|
@@ -462,6 +463,7 @@ files:
|
|
462
463
|
- lib/mutest/reporter/sequence.rb
|
463
464
|
- lib/mutest/repository.rb
|
464
465
|
- lib/mutest/require_highjack.rb
|
466
|
+
- lib/mutest/requirer.rb
|
465
467
|
- lib/mutest/result.rb
|
466
468
|
- lib/mutest/runner.rb
|
467
469
|
- lib/mutest/runner/sink.rb
|
@@ -697,7 +699,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
697
699
|
version: '0'
|
698
700
|
requirements: []
|
699
701
|
rubyforge_project:
|
700
|
-
rubygems_version: 2.
|
702
|
+
rubygems_version: 2.6.8
|
701
703
|
signing_key:
|
702
704
|
specification_version: 4
|
703
705
|
summary: Mutation testing for ruby
|