Change Env#output as read-only attribute
This commit is contained in:
parent
b67a32d27e
commit
22613059f1
@ -1,7 +1,8 @@
|
|||||||
module Producer
|
module Producer
|
||||||
module Core
|
module Core
|
||||||
class Env
|
class Env
|
||||||
attr_accessor :output, :target
|
attr_reader :output
|
||||||
|
attr_accessor :target
|
||||||
|
|
||||||
def initialize(output: $stdout)
|
def initialize(output: $stdout)
|
||||||
@output = output
|
@output = output
|
||||||
|
@ -7,7 +7,7 @@ module Producer::Core
|
|||||||
|
|
||||||
describe '#initialize' do
|
describe '#initialize' do
|
||||||
it 'assigns $stdout as the default output' do
|
it 'assigns $stdout as the default output' do
|
||||||
expect(env.instance_eval { @output }).to eq $stdout
|
expect(env.output).to be $stdout
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'assigns no default target' do
|
it 'assigns no default target' do
|
||||||
@ -18,7 +18,7 @@ module Producer::Core
|
|||||||
subject(:env) { Env.new(output: output) }
|
subject(:env) { Env.new(output: output) }
|
||||||
|
|
||||||
it 'assigns the given output' do
|
it 'assigns the given output' do
|
||||||
expect(env.instance_eval { @output }).to eq output
|
expect(env.output).to eq output
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user