2014-06-08 13:55:13 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2014-07-05 22:11:31 -04:00
|
|
|
describe Mutant::Isolation::None do
|
|
|
|
before do
|
|
|
|
@initial = 1
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '.run' do
|
|
|
|
let(:object) { described_class }
|
|
|
|
|
|
|
|
it 'does not isolate side effects' do
|
|
|
|
object.call { @initial = 2 }
|
|
|
|
expect(@initial).to be(2)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'return block value' do
|
|
|
|
expect(object.call { :foo }).to be(:foo)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe Mutant::Isolation::Fork do
|
|
|
|
before do
|
|
|
|
@initial = 1
|
|
|
|
end
|
|
|
|
|
2014-06-24 20:13:24 -04:00
|
|
|
describe '.run' do
|
2014-06-08 13:55:13 -04:00
|
|
|
let(:object) { described_class }
|
|
|
|
|
2014-07-05 22:11:31 -04:00
|
|
|
it 'does isolate side effects' do
|
|
|
|
object.call { @initial = 2 }
|
|
|
|
expect(@initial).to be(1)
|
2014-06-09 11:36:00 -04:00
|
|
|
end
|
|
|
|
|
2014-06-24 20:13:24 -04:00
|
|
|
it 'return block value' do
|
|
|
|
expect(object.call { :foo }).to be(:foo)
|
2014-06-08 13:55:13 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|