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