mutant 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9aa6cee93941cfb9307169023bb523bdc18c290a
4
- data.tar.gz: 3130e644fa7c02db1ed0adef9300d711269e7323
3
+ metadata.gz: 2d6ae44ce91c40d94361aed00cac550fcb5554ac
4
+ data.tar.gz: 848b79ae105ed3249cb2f8ade2d4c5bad65b240d
5
5
  SHA512:
6
- metadata.gz: eba0e605c2fd699c0bd22b08d65332701c14a190da37e017d400fadc8a7869b54dbfefb577c537d329da487039046e3868529a9ec88847d4c3f7a17cab0c1845
7
- data.tar.gz: 3ff08e6ca56e920894f440e90084599116731914c662f61780a09d800db505794207c79919ffb3dc945d1a3f9780280523527598932f0ef7f5e077e8d499c771
6
+ metadata.gz: 03488412903104aa688bd949081d33d0c5f87514727cde14c380cf856e389f91edfe8b493bddcf9d529a4f669d7fe44c2e22c43fe3b7d99795b2b27b6e776cbb
7
+ data.tar.gz: 272c8b14d6a38877d05686610d9b9a815697893e63dc103d26a0b2620c4e8b87e488fb3ec05c21988c09a95755df7c8dd0b5d0e0fa63493adb02eac68e18205d
@@ -1,3 +1,7 @@
1
+ # v0.7.6 2015-01-25
2
+
3
+ * Fix crash on using the null integration.
4
+
1
5
  # v0.7.5 2015-01-14
2
6
 
3
7
  * Bump deps to support MRI 2.2.
data/README.md CHANGED
@@ -176,7 +176,7 @@ Credits
176
176
  -------
177
177
 
178
178
  * [Markus Schirp (mbj)](https://github.com/mbj)
179
- * A [gist](https://gist.github.com/1065789) from [dkubb](https://github.com/dkubb) showing ideas.
179
+ * A gist, now removed, from [dkubb](https://github.com/dkubb) showing ideas.
180
180
  * Older abandoned [mutant](https://github.com/txus/mutant). For motivating me doing this one.
181
181
  * [heckle](https://github.com/seattlerb/heckle). For getting me into mutation testing.
182
182
 
data/circle.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  machine:
3
3
  ruby:
4
- version: '2.1'
4
+ version: '2.2'
5
5
  test:
6
6
  override:
7
7
  - bundle exec rake ci
@@ -127,6 +127,7 @@ UtilityFunction:
127
127
  - Mutant::Actor::Env#new_mailbox
128
128
  - Mutant::AST::Sexp#s
129
129
  - Mutant::CLI#reporter
130
+ - Mutant::Integration::Null#call
130
131
  - Mutant::Integration::Rspec#parse_example
131
132
  - Mutant::Meta::Example::Verification#format_mutation
132
133
  - Mutant::Reporter::CLI::Format::Progressive#new_buffer
@@ -40,9 +40,9 @@ module Mutant
40
40
 
41
41
  end # Message
42
42
 
43
- # Bindin to others actors sender for simple RPC
43
+ # Binding to othersactors sender for simple RPC
44
44
  class Binding
45
- include Concord.new(:actor, :other)
45
+ include Concord.new(:mailbox, :other)
46
46
 
47
47
  # Send message and wait for reply
48
48
  #
@@ -53,8 +53,8 @@ module Mutant
53
53
  # @api private
54
54
  #
55
55
  def call(type)
56
- other.call(Message.new(type, actor.sender))
57
- message = actor.receiver.call
56
+ other.call(Message.new(type, mailbox.sender))
57
+ message = mailbox.receiver.call
58
58
  fail ProtocolError, "Expected #{type} but got #{message.type}" unless type.equal?(message.type)
59
59
  message.payload
60
60
  end
@@ -77,6 +77,23 @@ module Mutant
77
77
  EMPTY_ARRAY
78
78
  end
79
79
 
80
+ # Return report for test
81
+ #
82
+ # @param [Enumerable<Mutant::Test>] tests
83
+ #
84
+ # @return [Result::Test]
85
+ #
86
+ # @api private
87
+ #
88
+ def call(tests)
89
+ Result::Test.new(
90
+ tests: tests,
91
+ output: '',
92
+ runtime: 0.0,
93
+ passed: true
94
+ )
95
+ end
96
+
80
97
  end # Null
81
98
 
82
99
  end # Integration
@@ -2,21 +2,21 @@ module Mutant
2
2
  module Parallel
3
3
  # Master parallel worker
4
4
  class Master
5
- include Concord.new(:config, :actor)
5
+ include Concord.new(:config, :mailbox)
6
6
 
7
7
  private_class_method :new
8
8
 
9
- # Run master runner component
9
+ # Run master
10
10
  #
11
- # @param [Env] env
11
+ # @param [Config] config
12
12
  #
13
13
  # @return [Actor::Sender]
14
14
  #
15
15
  # @api private
16
16
  #
17
17
  def self.call(config)
18
- config.env.spawn do |actor|
19
- new(config, actor).__send__(:run)
18
+ config.env.spawn do |mailbox|
19
+ new(config, mailbox).__send__(:run)
20
20
  end
21
21
  end
22
22
 
@@ -39,8 +39,6 @@ module Mutant
39
39
 
40
40
  # Run work loop
41
41
  #
42
- # @return [self]
43
- #
44
42
  # @api private
45
43
  #
46
44
  # rubocop:disable MethodLength
@@ -48,11 +46,11 @@ module Mutant
48
46
  def run
49
47
  config.jobs.times do
50
48
  @workers += 1
51
- config.env.spawn do |worker_actor|
49
+ config.env.spawn do |worker_mailbox|
52
50
  Worker.run(
53
- actor: worker_actor,
51
+ mailbox: worker_mailbox,
54
52
  processor: config.processor,
55
- parent: actor.sender
53
+ parent: mailbox.sender
56
54
  )
57
55
  end
58
56
  end
@@ -90,7 +88,7 @@ module Mutant
90
88
  # @api private
91
89
  #
92
90
  def receive_loop
93
- handle(actor.receiver.call) until @workers.zero? && @stop
91
+ handle(mailbox.receiver.call) until @workers.zero? && @stop
94
92
  end
95
93
 
96
94
  # Handle status
@@ -204,7 +202,7 @@ module Mutant
204
202
  config.source
205
203
  end
206
204
 
207
- # Return source
205
+ # Return sink
208
206
  #
209
207
  # @return [Sink]
210
208
  #
@@ -2,7 +2,7 @@ module Mutant
2
2
  module Parallel
3
3
  # Parallel execution worker
4
4
  class Worker
5
- include Adamantium::Flat, Anima.new(:actor, :processor, :parent)
5
+ include Adamantium::Flat, Anima.new(:mailbox, :processor, :parent)
6
6
 
7
7
  # Run worker
8
8
  #
@@ -29,8 +29,8 @@ module Mutant
29
29
  #
30
30
  def run
31
31
  begin
32
- parent.call(Actor::Message.new(:ready, actor.sender))
33
- end until handle(actor.receiver.call)
32
+ parent.call(Actor::Message.new(:ready, mailbox.sender))
33
+ end until handle(mailbox.receiver.call)
34
34
  end
35
35
 
36
36
  private
@@ -1,4 +1,4 @@
1
1
  module Mutant
2
2
  # The current mutant version
3
- VERSION = '0.7.5'.freeze
3
+ VERSION = '0.7.6'.freeze
4
4
  end # Mutant
@@ -16,11 +16,28 @@ RSpec.describe Mutant::Integration::Null do
16
16
 
17
17
  let(:object) { described_class.new }
18
18
 
19
- describe '#setup' do
19
+ describe '#all_tests' do
20
20
  subject { object.all_tests }
21
21
 
22
22
  it { should eql([]) }
23
23
 
24
24
  it_should_behave_like 'an idempotent method'
25
25
  end
26
+
27
+ describe '#call' do
28
+ let(:tests) { double('Tests') }
29
+
30
+ subject { object.call(tests) }
31
+
32
+ it 'returns test result' do
33
+ should eql(
34
+ Mutant::Result::Test.new(
35
+ tests: tests,
36
+ runtime: 0.0,
37
+ passed: true,
38
+ output: ''
39
+ )
40
+ )
41
+ end
42
+ end
26
43
  end
@@ -83,7 +83,7 @@ RSpec.describe Mutant::Parallel::Master do
83
83
 
84
84
  before do
85
85
  expect(Mutant::Parallel::Worker).to receive(:run).with(
86
- actor: actor_env.mailbox(:worker_a),
86
+ mailbox: actor_env.mailbox(:worker_a),
87
87
  processor: processor,
88
88
  parent: actor_env.mailbox(:master).sender
89
89
  ).and_return(worker_a)
@@ -97,7 +97,7 @@ RSpec.describe Mutant::Parallel::Master do
97
97
 
98
98
  before do
99
99
  expect(Mutant::Parallel::Worker).to receive(:run).with(
100
- actor: actor_env.mailbox(:worker_b),
100
+ mailbox: actor_env.mailbox(:worker_b),
101
101
  processor: processor,
102
102
  parent: actor_env.mailbox(:master).sender
103
103
  ).and_return(worker_b)
@@ -5,7 +5,7 @@ RSpec.describe Mutant::Parallel::Worker do
5
5
 
6
6
  let(:message_sequence) { FakeActor::MessageSequence.new }
7
7
  let(:processor) { double('Processor') }
8
- let(:actor) { actor_env.mailbox(:worker) }
8
+ let(:mailbox) { actor_env.mailbox(:worker) }
9
9
  let(:parent) { actor_env.mailbox(:parent).sender }
10
10
  let(:payload) { double('Payload') }
11
11
  let(:result_payload) { double('Result Payload') }
@@ -14,12 +14,12 @@ RSpec.describe Mutant::Parallel::Worker do
14
14
  {
15
15
  processor: processor,
16
16
  parent: parent,
17
- actor: actor
17
+ mailbox: mailbox
18
18
  }
19
19
  end
20
20
 
21
21
  before do
22
- message_sequence.add(:parent, :ready, actor.sender)
22
+ message_sequence.add(:parent, :ready, mailbox.sender)
23
23
  end
24
24
 
25
25
  describe '.run' do
@@ -36,7 +36,7 @@ RSpec.describe Mutant::Parallel::Worker do
36
36
 
37
37
  message_sequence.add(:worker, :job, job)
38
38
  message_sequence.add(:parent, :result, job_result)
39
- message_sequence.add(:parent, :ready, actor.sender)
39
+ message_sequence.add(:parent, :ready, mailbox.sender)
40
40
  message_sequence.add(:worker, :stop)
41
41
  end
42
42
 
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.7.5
4
+ version: 0.7.6
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-01-14 00:00:00.000000000 Z
11
+ date: 2015-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser