Use class_double where appropriate
This commit is contained in:
parent
efd1202223
commit
8439096e11
6 changed files with 21 additions and 27 deletions
|
@ -1,6 +1,6 @@
|
||||||
RSpec.describe Mutant::Actor::Env do
|
RSpec.describe Mutant::Actor::Env do
|
||||||
let(:thread) { instance_double(Thread) }
|
let(:thread) { instance_double(Thread) }
|
||||||
let(:thread_root) { instance_double(Thread.singleton_class) }
|
let(:thread_root) { class_double(Thread) }
|
||||||
|
|
||||||
let(:object) { described_class.new(thread_root) }
|
let(:object) { described_class.new(thread_root) }
|
||||||
|
|
||||||
|
|
|
@ -13,18 +13,15 @@ RSpec.describe Mutant::Env do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:integration) { instance_double(Mutant::Integration) }
|
let(:integration) { instance_double(Mutant::Integration) }
|
||||||
let(:wrapped_node) { instance_double(Parser::AST::Node) }
|
let(:wrapped_node) { instance_double(Parser::AST::Node) }
|
||||||
let(:context) { instance_double(Mutant::Context) }
|
let(:context) { instance_double(Mutant::Context) }
|
||||||
let(:test_a) { instance_double(Mutant::Test) }
|
let(:test_a) { instance_double(Mutant::Test) }
|
||||||
let(:test_b) { instance_double(Mutant::Test) }
|
let(:test_b) { instance_double(Mutant::Test) }
|
||||||
let(:tests) { [test_a, test_b] }
|
let(:tests) { [test_a, test_b] }
|
||||||
let(:selector) { instance_double(Mutant::Selector) }
|
let(:selector) { instance_double(Mutant::Selector) }
|
||||||
let(:integration_class) { Mutant::Integration::Null }
|
let(:integration_class) { Mutant::Integration::Null }
|
||||||
|
let(:isolation) { class_double(Mutant::Isolation::Fork) }
|
||||||
let(:isolation) do
|
|
||||||
instance_double(Mutant::Isolation::Fork.singleton_class)
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:mutation) do
|
let(:mutation) do
|
||||||
instance_double(
|
instance_double(
|
||||||
|
@ -37,7 +34,7 @@ RSpec.describe Mutant::Env do
|
||||||
Mutant::Config::DEFAULT.with(
|
Mutant::Config::DEFAULT.with(
|
||||||
isolation: isolation,
|
isolation: isolation,
|
||||||
integration: integration_class,
|
integration: integration_class,
|
||||||
kernel: instance_double(Kernel.singleton_class)
|
kernel: class_double(Kernel)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ RSpec.describe Mutant::Loader, '.call' do
|
||||||
let(:path) { instance_double(Pathname, to_s: path_str) }
|
let(:path) { instance_double(Pathname, to_s: path_str) }
|
||||||
let(:path_str) { instance_double(String) }
|
let(:path_str) { instance_double(String) }
|
||||||
let(:line) { instance_double(Fixnum) }
|
let(:line) { instance_double(Fixnum) }
|
||||||
let(:kernel) { instance_double(Kernel.singleton_class) }
|
let(:kernel) { class_double(Kernel) }
|
||||||
let(:binding) { instance_double(Binding) }
|
let(:binding) { instance_double(Binding) }
|
||||||
let(:source) { instance_double(String) }
|
let(:source) { instance_double(String) }
|
||||||
let(:node) { instance_double(Parser::AST::Node) }
|
let(:node) { instance_double(Parser::AST::Node) }
|
||||||
|
|
|
@ -17,12 +17,12 @@ describe Mutant::Repository::Diff do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:pathname) { instance_double(Pathname.singleton_class, pwd: pwd) }
|
let(:pathname) { class_double(Pathname, pwd: pwd) }
|
||||||
let(:open3) { instance_double(Open3.singleton_class) }
|
let(:open3) { class_double(Open3) }
|
||||||
let(:kernel) { instance_double(Kernel.singleton_class) }
|
let(:kernel) { class_double(Kernel) }
|
||||||
let(:pwd) { Pathname.new('/foo') }
|
let(:pwd) { Pathname.new('/foo') }
|
||||||
let(:path) { Pathname.new('/foo/bar.rb') }
|
let(:path) { Pathname.new('/foo/bar.rb') }
|
||||||
let(:line_range) { 1..2 }
|
let(:line_range) { 1..2 }
|
||||||
|
|
||||||
subject { object.touches?(path, line_range) }
|
subject { object.touches?(path, line_range) }
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ RSpec.describe Mutant::Runner do
|
||||||
let(:delay) { instance_double(Float) }
|
let(:delay) { instance_double(Float) }
|
||||||
let(:env_result) { instance_double(Mutant::Result::Env) }
|
let(:env_result) { instance_double(Mutant::Result::Env) }
|
||||||
let(:actor_env) { instance_double(Mutant::Actor::Env) }
|
let(:actor_env) { instance_double(Mutant::Actor::Env) }
|
||||||
let(:kernel) { instance_double(Kernel.singleton_class) }
|
let(:kernel) { class_double(Kernel) }
|
||||||
let(:sleep) { instance_double(Method) }
|
let(:sleep) { instance_double(Method) }
|
||||||
|
|
||||||
let(:env) do
|
let(:env) do
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
RSpec.describe Mutant::Zombifier do
|
RSpec.describe Mutant::Zombifier do
|
||||||
let(:root_require) { Pathname.new('project') }
|
let(:root_require) { Pathname.new('project') }
|
||||||
|
let(:pathname) { class_double(Pathname) }
|
||||||
let(:pathname) do
|
|
||||||
instance_double(::Pathname.singleton_class)
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:require_highjack) do
|
let(:require_highjack) do
|
||||||
lambda do |block|
|
lambda do |block|
|
||||||
|
|
Loading…
Reference in a new issue