Change Env#output as read-only attribute

This commit is contained in:
Thibault Jouan 2014-01-09 01:22:43 +00:00
parent b67a32d27e
commit 22613059f1
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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