2014-06-08 17:55:13 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Mutant::Isolation do
|
2014-06-25 00:13:24 +00:00
|
|
|
describe '.run' do
|
2014-06-08 17:55:13 +00:00
|
|
|
let(:object) { described_class }
|
|
|
|
|
2014-06-25 00:13:24 +00:00
|
|
|
it 'isolates global effects from process' do
|
2014-06-29 21:32:26 +00:00
|
|
|
expect(defined?(::TestConstant)).to be(nil)
|
|
|
|
object.call { ::TestConstant = 1 }
|
|
|
|
expect(defined?(::TestConstant)).to be(nil)
|
2014-06-09 15:36:00 +00:00
|
|
|
end
|
|
|
|
|
2014-06-25 00:13:24 +00:00
|
|
|
it 'return block value' do
|
|
|
|
expect(object.call { :foo }).to be(:foo)
|
2014-06-08 17:55:13 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|