mutant 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +8 -0
  3. data/Gemfile +1 -4
  4. data/Gemfile.shared +3 -0
  5. data/Rakefile +0 -2
  6. data/config/flay.yml +1 -1
  7. data/config/rubocop.yml +8 -0
  8. data/lib/mutant.rb +2 -0
  9. data/lib/mutant/ast/meta/restarg.rb +15 -0
  10. data/lib/mutant/ast/meta/symbol.rb +15 -0
  11. data/lib/mutant/cli.rb +11 -11
  12. data/lib/mutant/config.rb +1 -1
  13. data/lib/mutant/env.rb +1 -1
  14. data/lib/mutant/matcher/config.rb +2 -2
  15. data/lib/mutant/mutator/node/block.rb +16 -0
  16. data/lib/mutant/mutator/node/define.rb +14 -0
  17. data/lib/mutant/mutator/node/send.rb +12 -1
  18. data/lib/mutant/mutator/node/send/binary.rb +25 -1
  19. data/lib/mutant/parallel.rb +2 -2
  20. data/lib/mutant/result.rb +1 -1
  21. data/lib/mutant/runner/sink.rb +2 -2
  22. data/lib/mutant/version.rb +1 -1
  23. data/meta/begin.rb +0 -2
  24. data/meta/block.rb +15 -0
  25. data/meta/def.rb +25 -0
  26. data/meta/or_asgn.rb +9 -0
  27. data/meta/send.rb +41 -1
  28. data/mutant-rspec.gemspec +0 -2
  29. data/mutant.gemspec +5 -6
  30. data/spec/spec_helper.rb +1 -1
  31. data/spec/support/corpus.rb +1 -0
  32. data/spec/support/shared_context.rb +5 -5
  33. data/spec/unit/mutant/cli_spec.rb +6 -6
  34. data/spec/unit/mutant/env/boostrap_spec.rb +3 -3
  35. data/spec/unit/mutant/env_spec.rb +1 -1
  36. data/spec/unit/mutant/matcher/compiler_spec.rb +1 -1
  37. data/spec/unit/mutant/parallel/master_spec.rb +2 -2
  38. data/spec/unit/mutant/reporter/cli/printer/config_spec.rb +1 -1
  39. data/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb +3 -3
  40. data/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb +1 -1
  41. data/spec/unit/mutant/reporter/cli/printer/mutation_progress_result_spec.rb +2 -2
  42. data/spec/unit/mutant/reporter/cli/printer/mutation_result_spec.rb +3 -3
  43. data/spec/unit/mutant/reporter/cli/printer/status_progressive_spec.rb +5 -5
  44. data/spec/unit/mutant/reporter/cli/printer/status_spec.rb +5 -5
  45. data/spec/unit/mutant/reporter/cli/printer/subject_progress_spec.rb +2 -2
  46. data/spec/unit/mutant/reporter/cli/printer/subject_result_spec.rb +2 -2
  47. data/spec/unit/mutant/reporter/cli_spec.rb +6 -4
  48. data/spec/unit/mutant/result_spec.rb +23 -0
  49. data/spec/unit/mutant/runner/sink/mutation_spec.rb +8 -8
  50. data/spec/unit/mutant/selector/expression_spec.rb +1 -1
  51. data/test_app/Gemfile.rspec3.2 +1 -0
  52. data/test_app/Gemfile.rspec3.3 +1 -0
  53. data/test_app/spec/unit/test_app/literal_spec.rb +0 -2
  54. metadata +27 -18
  55. data/Guardfile +0 -16
  56. data/test_app/Gemfile.rspec3.0 +0 -6
  57. data/test_app/Gemfile.rspec3.1 +0 -6
@@ -12,7 +12,7 @@ RSpec.describe Mutant::Reporter::CLI::Printer::SubjectResult do
12
12
  end
13
13
 
14
14
  context 'on partial coverage' do
15
- update(:mutation_a_test_result) { { passed: true } }
15
+ with(:mutation_a_test_result) { { passed: true } }
16
16
 
17
17
  it_reports <<-'STR'
18
18
  subject-a
@@ -26,7 +26,7 @@ RSpec.describe Mutant::Reporter::CLI::Printer::SubjectResult do
26
26
  end
27
27
 
28
28
  context 'without results' do
29
- update(:subject_a_result) { { mutation_results: [] } }
29
+ with(:subject_a_result) { { mutation_results: [] } }
30
30
 
31
31
  it_reports <<-'STR'
32
32
  subject-a
@@ -132,7 +132,8 @@ RSpec.describe Mutant::Reporter::CLI do
132
132
 
133
133
  context 'with non default coverage expectation' do
134
134
  let(:format) { progressive_format }
135
- update(:config) { { expected_coverage: 0.1r } }
135
+
136
+ with(:config) { { expected_coverage: 0.1r } }
136
137
 
137
138
  it_reports(<<-REPORT)
138
139
  Mutant configuration:
@@ -204,7 +205,7 @@ RSpec.describe Mutant::Reporter::CLI do
204
205
  let(:format) { progressive_format }
205
206
 
206
207
  context 'with empty scheduler' do
207
- update(:env_result) { { subject_results: [] } }
208
+ with(:env_result) { { subject_results: [] } }
208
209
 
209
210
  let(:tty?) { true }
210
211
 
@@ -212,14 +213,15 @@ RSpec.describe Mutant::Reporter::CLI do
212
213
  end
213
214
 
214
215
  context 'with last mutation present' do
215
- update(:env_result) { { subject_results: [subject_a_result] } }
216
+ with(:env_result) { { subject_results: [subject_a_result] } }
216
217
 
217
218
  context 'when mutation is successful' do
218
219
  it_reports "(02/02) 100% - killtime: 2.00s runtime: 4.00s overhead: 2.00s\n"
219
220
  end
220
221
 
221
222
  context 'when mutation is NOT successful' do
222
- update(:mutation_a_test_result) { { passed: true } }
223
+ with(:mutation_a_test_result) { { passed: true } }
224
+
223
225
  it_reports "(01/02) 50% - killtime: 2.00s runtime: 4.00s overhead: 2.00s\n"
224
226
  end
225
227
  end
@@ -0,0 +1,23 @@
1
+ RSpec.describe Mutant::Result do
2
+ describe '.included' do
3
+ let(:object) do
4
+ Class.new do
5
+ include Mutant::Result
6
+
7
+ def collection
8
+ [[1]]
9
+ end
10
+
11
+ sum :length, :collection
12
+ end.new
13
+ end
14
+
15
+ it 'includes mixin to freeze instances' do
16
+ expect(object.frozen?).to be(true)
17
+ end
18
+
19
+ it 'it makes DSL methods from Mutant::Result available' do
20
+ expect(object.length).to be(1)
21
+ end
22
+ end
23
+ end
@@ -52,7 +52,7 @@ describe Mutant::Runner::Sink::Mutation do
52
52
  context 'one result' do
53
53
  include_context 'one result'
54
54
 
55
- update(:subject_a_result) { { mutation_results: [mutation_a_result] } }
55
+ with(:subject_a_result) { { mutation_results: [mutation_a_result] } }
56
56
 
57
57
  let(:expected_status) do
58
58
  Mutant::Result::Env.new(env: env, runtime: 0.0, subject_results: [subject_a_result])
@@ -88,7 +88,7 @@ describe Mutant::Runner::Sink::Mutation do
88
88
  end
89
89
 
90
90
  context 'when result failed' do
91
- update(:mutation_a_test_result) { { passed: true } }
91
+ with(:mutation_a_test_result) { { passed: true } }
92
92
 
93
93
  it { should be(false) }
94
94
  end
@@ -102,13 +102,13 @@ describe Mutant::Runner::Sink::Mutation do
102
102
  end
103
103
 
104
104
  context 'when first result is unsuccessful' do
105
- update(:mutation_a_test_result) { { passed: true } }
105
+ with(:mutation_a_test_result) { { passed: true } }
106
106
 
107
107
  it { should be(false) }
108
108
  end
109
109
 
110
110
  context 'when second result is unsuccessful' do
111
- update(:mutation_b_test_result) { { passed: true } }
111
+ with(:mutation_b_test_result) { { passed: true } }
112
112
 
113
113
  it { should be(false) }
114
114
  end
@@ -116,7 +116,7 @@ describe Mutant::Runner::Sink::Mutation do
116
116
  end
117
117
 
118
118
  context 'with fail fast' do
119
- update(:config) { { fail_fast: true } }
119
+ with(:config) { { fail_fast: true } }
120
120
 
121
121
  context 'no results' do
122
122
  it { should be(false) }
@@ -130,7 +130,7 @@ describe Mutant::Runner::Sink::Mutation do
130
130
  end
131
131
 
132
132
  context 'when result failed' do
133
- update(:mutation_a_test_result) { { passed: true } }
133
+ with(:mutation_a_test_result) { { passed: true } }
134
134
 
135
135
  it { should be(true) }
136
136
  end
@@ -144,13 +144,13 @@ describe Mutant::Runner::Sink::Mutation do
144
144
  end
145
145
 
146
146
  context 'when first result is unsuccessful' do
147
- update(:mutation_a_test_result) { { passed: true } }
147
+ with(:mutation_a_test_result) { { passed: true } }
148
148
 
149
149
  it { should be(true) }
150
150
  end
151
151
 
152
152
  context 'when second result is unsuccessful' do
153
- update(:mutation_b_test_result) { { passed: true } }
153
+ with(:mutation_b_test_result) { { passed: true } }
154
154
 
155
155
  it { should be(true) }
156
156
  end
@@ -19,7 +19,7 @@ RSpec.describe Mutant::Selector::Expression do
19
19
  let(:mutation_subject) { subject_class.new(context, node) }
20
20
  let(:context) { double('Context') }
21
21
  let(:node) { double('Node') }
22
- let(:config) { Mutant::Config::DEFAULT.update(integration: integration) }
22
+ let(:config) { Mutant::Config::DEFAULT.with(integration: integration) }
23
23
  let(:integration) { double('Integration', all_tests: all_tests) }
24
24
  let(:test_a) { double('test a', expression: parse_expression('SubjectA')) }
25
25
  let(:test_b) { double('test b', expression: parse_expression('SubjectB')) }
@@ -4,3 +4,4 @@ gem 'rspec-core', '~> 3.2.0'
4
4
  gem 'mutant', path: '../'
5
5
  gem 'mutant-rspec', path: '../'
6
6
  gem 'adamantium'
7
+ eval_gemfile File.expand_path('../../Gemfile.shared', __FILE__)
@@ -4,3 +4,4 @@ gem 'rspec-core', '~> 3.3.0'
4
4
  gem 'mutant', path: '../'
5
5
  gem 'mutant-rspec', path: '../'
6
6
  gem 'adamantium'
7
+ eval_gemfile File.expand_path('../../Gemfile.shared', __FILE__)
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  require 'spec_helper'
4
2
 
5
3
  RSpec.describe TestApp::Literal do
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.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-01 00:00:00.000000000 Z
11
+ date: 2015-09-10 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: 0.2.4
75
+ version: 0.2.5
76
76
  type: :runtime
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: 0.2.4
82
+ version: 0.2.5
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: procto
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.2.0
187
+ version: 0.3.0
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 0.2.0
194
+ version: 0.3.0
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: concord
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -207,25 +207,33 @@ dependencies:
207
207
  - !ruby/object:Gem::Version
208
208
  version: 0.1.5
209
209
  - !ruby/object:Gem::Dependency
210
- name: bundler
210
+ name: devtools
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '1.3'
216
- - - ">="
217
- - !ruby/object:Gem::Version
218
- version: 1.3.5
215
+ version: 0.1.1
219
216
  type: :development
220
217
  prerelease: false
221
218
  version_requirements: !ruby/object:Gem::Requirement
222
219
  requirements:
223
220
  - - "~>"
224
221
  - !ruby/object:Gem::Version
225
- version: '1.3'
226
- - - ">="
222
+ version: 0.1.1
223
+ - !ruby/object:Gem::Dependency
224
+ name: bundler
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '1.10'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
227
235
  - !ruby/object:Gem::Version
228
- version: 1.3.5
236
+ version: '1.10'
229
237
  - !ruby/object:Gem::Dependency
230
238
  name: ffi
231
239
  requirement: !ruby/object:Gem::Requirement
@@ -256,7 +264,7 @@ files:
256
264
  - ".ruby-gemset"
257
265
  - Changelog.md
258
266
  - Gemfile
259
- - Guardfile
267
+ - Gemfile.shared
260
268
  - LICENSE
261
269
  - README.md
262
270
  - Rakefile
@@ -281,7 +289,9 @@ files:
281
289
  - lib/mutant/ast/meta.rb
282
290
  - lib/mutant/ast/meta/optarg.rb
283
291
  - lib/mutant/ast/meta/resbody.rb
292
+ - lib/mutant/ast/meta/restarg.rb
284
293
  - lib/mutant/ast/meta/send.rb
294
+ - lib/mutant/ast/meta/symbol.rb
285
295
  - lib/mutant/ast/named_children.rb
286
296
  - lib/mutant/ast/node_predicates.rb
287
297
  - lib/mutant/ast/nodes.rb
@@ -560,6 +570,7 @@ files:
560
570
  - spec/unit/mutant/require_highjack_spec.rb
561
571
  - spec/unit/mutant/result/env_spec.rb
562
572
  - spec/unit/mutant/result/subject_spec.rb
573
+ - spec/unit/mutant/result_spec.rb
563
574
  - spec/unit/mutant/runner/driver_spec.rb
564
575
  - spec/unit/mutant/runner/sink/mutation_spec.rb
565
576
  - spec/unit/mutant/runner_spec.rb
@@ -571,8 +582,6 @@ files:
571
582
  - spec/unit/mutant/zombifier_spec.rb
572
583
  - spec/unit/mutant_spec.rb
573
584
  - test_app/.rspec
574
- - test_app/Gemfile.rspec3.0
575
- - test_app/Gemfile.rspec3.1
576
585
  - test_app/Gemfile.rspec3.2
577
586
  - test_app/Gemfile.rspec3.3
578
587
  - test_app/lib/test_app.rb
@@ -677,6 +686,7 @@ test_files:
677
686
  - spec/unit/mutant/require_highjack_spec.rb
678
687
  - spec/unit/mutant/result/env_spec.rb
679
688
  - spec/unit/mutant/result/subject_spec.rb
689
+ - spec/unit/mutant/result_spec.rb
680
690
  - spec/unit/mutant/runner/driver_spec.rb
681
691
  - spec/unit/mutant/runner/sink/mutation_spec.rb
682
692
  - spec/unit/mutant/runner_spec.rb
@@ -687,4 +697,3 @@ test_files:
687
697
  - spec/unit/mutant/warning_filter_spec.rb
688
698
  - spec/unit/mutant/zombifier_spec.rb
689
699
  - spec/unit/mutant_spec.rb
690
- has_rdoc:
data/Guardfile DELETED
@@ -1,16 +0,0 @@
1
- # encoding: utf-8
2
-
3
- guard :bundler do
4
- watch('Gemfile')
5
- end
6
-
7
- guard :rspec, :all_after_pass => false, :all_on_start => false, :cmd => 'bundle exec rspec --fail-fast --seed 0' do
8
- # run all specs if the spec_helper or supporting files files are modified
9
- watch('spec/spec_helper.rb') { 'spec/unit' }
10
- watch(%r{\Aspec/(?:lib|support|shared)/.+\.rb\z}) { 'spec/unit' }
11
-
12
- watch(%r{lib/.*.rb}) { 'spec/unit' }
13
-
14
- # run a spec if it is modified
15
- watch(%r{\Aspec/.+_spec\.rb\z})
16
- end
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
- gem 'rspec', '~> 3.0.0'
3
- gem 'rspec-core', '~> 3.0.0'
4
- gem 'mutant', path: '../'
5
- gem 'mutant-rspec', path: '../'
6
- gem 'adamantium'
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
- gem 'rspec', '~> 3.1.0'
3
- gem 'rspec-core', '~> 3.1.0'
4
- gem 'mutant', path: '../'
5
- gem 'mutant-rspec', path: '../'
6
- gem 'adamantium'