mutiny 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +18 -17
- data/RELEASES.md +4 -0
- data/lib/mutiny/mutants/mutant.rb +3 -2
- data/lib/mutiny/mutants/mutant_set.rb +5 -1
- data/lib/mutiny/mutants/mutation.rb +4 -0
- data/lib/mutiny/mutants/mutation_set.rb +8 -4
- data/lib/mutiny/version.rb +1 -1
- data/mutiny.gemspec +1 -1
- data/spec/integration/mutate_spec.rb +21 -0
- data/spec/unit/mutants/mutation_set_spec.rb +1 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 346e69f9b36cf9c2a778b2e62bd51571d171e0f1
|
4
|
+
data.tar.gz: 7b08e6ec512f813849038ef15ef718d0b415bafd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cdfbdd49e7349e67cc27fc48a28031a4fe3931952c1bdf13d823a99832b93836f0f59e91aae11d1aa6ffb05cc022d1d7d07d21b377cbf99fc457dbf94aef28e
|
7
|
+
data.tar.gz: 0229bca2450718da9ed3484c5070fd8a6d524cca72392621582c63ef4e59a107b40d93698ec787913a2b4e454621a05e7b48916e356cd20a2e5de0beac5eed05
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mutiny (0.2.
|
4
|
+
mutiny (0.2.3)
|
5
5
|
gli (~> 2.13.0)
|
6
6
|
metamorpher (~> 0.2.2)
|
7
7
|
parser (~> 2.2.2)
|
@@ -18,34 +18,35 @@ GEM
|
|
18
18
|
childprocess (>= 0.3.6)
|
19
19
|
cucumber (>= 1.1.1)
|
20
20
|
rspec-expectations (>= 2.7.0)
|
21
|
-
ast (2.
|
21
|
+
ast (2.2.0)
|
22
22
|
astrolabe (1.3.1)
|
23
23
|
parser (~> 2.2)
|
24
24
|
attributable (0.1.0)
|
25
25
|
builder (3.2.2)
|
26
|
-
childprocess (0.5.
|
26
|
+
childprocess (0.5.9)
|
27
27
|
ffi (~> 1.0, >= 1.0.11)
|
28
|
-
codeclimate-test-reporter (0.4.
|
28
|
+
codeclimate-test-reporter (0.4.8)
|
29
29
|
simplecov (>= 0.7.1, < 1.0.0)
|
30
30
|
concord (0.1.5)
|
31
31
|
adamantium (~> 0.2.0)
|
32
32
|
equalizer (~> 0.0.9)
|
33
|
-
cucumber (2.
|
33
|
+
cucumber (2.3.2)
|
34
34
|
builder (>= 2.1.2)
|
35
|
-
cucumber-core (~> 1.
|
35
|
+
cucumber-core (~> 1.4.0)
|
36
|
+
cucumber-wire (~> 0.0.1)
|
36
37
|
diff-lcs (>= 1.1.3)
|
37
|
-
gherkin (~> 2.
|
38
|
+
gherkin (~> 3.2.0)
|
38
39
|
multi_json (>= 1.7.5, < 2.0)
|
39
40
|
multi_test (>= 0.1.2)
|
40
|
-
cucumber-core (1.
|
41
|
-
gherkin (~> 2.
|
41
|
+
cucumber-core (1.4.0)
|
42
|
+
gherkin (~> 3.2.0)
|
43
|
+
cucumber-wire (0.0.1)
|
42
44
|
diff-lcs (1.2.5)
|
43
45
|
docile (1.1.5)
|
44
46
|
equalizer (0.0.11)
|
45
47
|
ffi (1.9.10)
|
46
|
-
gherkin (2.
|
47
|
-
|
48
|
-
gli (2.13.2)
|
48
|
+
gherkin (3.2.0)
|
49
|
+
gli (2.13.4)
|
49
50
|
ice_nine (0.11.1)
|
50
51
|
json (1.8.3)
|
51
52
|
memoizable (0.4.2)
|
@@ -56,11 +57,11 @@ GEM
|
|
56
57
|
unparser (~> 0.2.4)
|
57
58
|
multi_json (1.11.2)
|
58
59
|
multi_test (0.1.2)
|
59
|
-
parser (2.2.
|
60
|
+
parser (2.2.3.0)
|
60
61
|
ast (>= 1.1, < 3.0)
|
61
62
|
powerpack (0.1.1)
|
62
63
|
procto (0.0.2)
|
63
|
-
rainbow (2.
|
64
|
+
rainbow (2.1.0)
|
64
65
|
rake (10.4.2)
|
65
66
|
rspec (3.3.0)
|
66
67
|
rspec-core (~> 3.3.0)
|
@@ -82,7 +83,7 @@ GEM
|
|
82
83
|
rainbow (>= 1.99.1, < 3.0)
|
83
84
|
ruby-progressbar (~> 1.4)
|
84
85
|
ruby-progressbar (1.7.5)
|
85
|
-
simplecov (0.
|
86
|
+
simplecov (0.11.1)
|
86
87
|
docile (~> 1.1.0)
|
87
88
|
json (~> 1.8)
|
88
89
|
simplecov-html (~> 0.10.0)
|
@@ -102,7 +103,7 @@ PLATFORMS
|
|
102
103
|
|
103
104
|
DEPENDENCIES
|
104
105
|
aruba (~> 0.7.0)
|
105
|
-
bundler (~> 1.
|
106
|
+
bundler (~> 1.11)
|
106
107
|
codeclimate-test-reporter (~> 0.4.6)
|
107
108
|
mutiny!
|
108
109
|
rake (~> 10.4.2)
|
@@ -110,4 +111,4 @@ DEPENDENCIES
|
|
110
111
|
rubocop (~> 0.33.0)
|
111
112
|
|
112
113
|
BUNDLED WITH
|
113
|
-
1.
|
114
|
+
1.11.2
|
data/RELEASES.md
CHANGED
@@ -3,12 +3,13 @@ require 'fileutils'
|
|
3
3
|
module Mutiny
|
4
4
|
module Mutants
|
5
5
|
class Mutant
|
6
|
-
attr_reader :subject, :code, :stillborn
|
6
|
+
attr_reader :subject, :code, :mutation_name, :stillborn
|
7
7
|
alias_method :stillborn?, :stillborn
|
8
8
|
|
9
|
-
def initialize(subject: nil, code:)
|
9
|
+
def initialize(subject: nil, code:, mutation_name: nil)
|
10
10
|
@subject = subject
|
11
11
|
@code = code
|
12
|
+
@mutation_name = mutation_name
|
12
13
|
@stillborn = false
|
13
14
|
end
|
14
15
|
|
@@ -52,7 +52,11 @@ module Mutiny
|
|
52
52
|
def store(directory)
|
53
53
|
path = File.join(directory, identifier)
|
54
54
|
FileUtils.mkdir_p(File.dirname(path))
|
55
|
-
File.open(path, 'w') { |f| f.write(
|
55
|
+
File.open(path, 'w') { |f| f.write(serialised) }
|
56
|
+
end
|
57
|
+
|
58
|
+
def serialised
|
59
|
+
"# " + mutation_name + "\n" + code
|
56
60
|
end
|
57
61
|
end
|
58
62
|
end
|
@@ -24,11 +24,15 @@ module Mutiny
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def mutate_one(subject, mutation)
|
27
|
-
mutation
|
28
|
-
.
|
29
|
-
|
27
|
+
safely_mutate_file(subject.path, mutation).map do |code|
|
28
|
+
Mutant.new(subject: subject, code: code, mutation_name: mutation.short_name)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def safely_mutate_file(path, mutation)
|
33
|
+
mutation.mutate_file(path)
|
30
34
|
rescue
|
31
|
-
msg = "Error encountered whilst mutating file at '#{
|
35
|
+
msg = "Error encountered whilst mutating file at '#{path}' with #{mutation.name}"
|
32
36
|
raise Mutation::Error, msg
|
33
37
|
end
|
34
38
|
end
|
data/lib/mutiny/version.rb
CHANGED
data/mutiny.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency "gli", "~> 2.13.0"
|
24
24
|
spec.add_runtime_dependency "metamorpher", "~> 0.2.2"
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler", "~> 1.
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.4.2"
|
28
28
|
spec.add_development_dependency "rspec", "~> 3.3.0"
|
29
29
|
spec.add_development_dependency "aruba", "~> 0.7.0"
|
@@ -32,4 +32,25 @@ describe "Using Mutiny to generate mutants" do
|
|
32
32
|
check_file_content(".mutants/calculator/max.5.rb", /if right != left/)
|
33
33
|
check_file_content(".mutants/calculator/max.6.rb", /if right >= left/)
|
34
34
|
end
|
35
|
+
|
36
|
+
it "should write mutation name to each mutant" do
|
37
|
+
cd "calculator"
|
38
|
+
run "bundle exec mutiny mutate"
|
39
|
+
|
40
|
+
check_file_content(".mutants/calculator/min.0.rb", /# RelationalExpressionReplacement/)
|
41
|
+
check_file_content(".mutants/calculator/min.1.rb", /# RelationalExpressionReplacement/)
|
42
|
+
check_file_content(".mutants/calculator/min.2.rb", /# RelationalOperatorReplacement/)
|
43
|
+
check_file_content(".mutants/calculator/min.3.rb", /# RelationalOperatorReplacement/)
|
44
|
+
check_file_content(".mutants/calculator/min.4.rb", /# RelationalOperatorReplacement/)
|
45
|
+
check_file_content(".mutants/calculator/min.5.rb", /# RelationalOperatorReplacement/)
|
46
|
+
check_file_content(".mutants/calculator/min.6.rb", /# RelationalOperatorReplacement/)
|
47
|
+
|
48
|
+
check_file_content(".mutants/calculator/max.0.rb", /# RelationalExpressionReplacement/)
|
49
|
+
check_file_content(".mutants/calculator/max.1.rb", /# RelationalExpressionReplacement/)
|
50
|
+
check_file_content(".mutants/calculator/max.2.rb", /# RelationalOperatorReplacement/)
|
51
|
+
check_file_content(".mutants/calculator/max.3.rb", /# RelationalOperatorReplacement/)
|
52
|
+
check_file_content(".mutants/calculator/max.4.rb", /# RelationalOperatorReplacement/)
|
53
|
+
check_file_content(".mutants/calculator/max.5.rb", /# RelationalOperatorReplacement/)
|
54
|
+
check_file_content(".mutants/calculator/max.6.rb", /# RelationalOperatorReplacement/)
|
55
|
+
end
|
35
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutiny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis Rose
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: '1.11'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: '1.11'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
291
|
version: '0'
|
292
292
|
requirements: []
|
293
293
|
rubyforge_project:
|
294
|
-
rubygems_version: 2.4.5
|
294
|
+
rubygems_version: 2.4.5.1
|
295
295
|
signing_key:
|
296
296
|
specification_version: 4
|
297
297
|
summary: A tiny mutation testing framework for Ruby
|