Implement Action#input, delegating to env input

This commit is contained in:
Thibault Jouan 2014-01-20 22:26:58 +00:00
parent a871bb4009
commit 70109615c8
2 changed files with 9 additions and 2 deletions

View File

@ -4,7 +4,7 @@ module Producer
require 'forwardable'
extend Forwardable
def_delegators :@env, :output, :remote
def_delegators :@env, :input, :output, :remote
def_delegators :remote, :fs
attr_reader :env, :arguments

View File

@ -2,8 +2,9 @@ require 'spec_helper'
module Producer::Core
describe Action do
let(:input) { StringIO.new }
let(:output) { StringIO.new }
let(:env) { Env.new(output: output) }
let(:env) { Env.new(input: input, output: output) }
let(:arguments) { [:some, :arguments] }
subject(:action) { Action.new(env, *arguments) }
@ -19,6 +20,12 @@ module Producer::Core
end
end
describe '#input' do
it 'returns env input' do
expect(action.input).to be input
end
end
describe '#output' do
it 'delegates to env output' do
action.output.puts 'some content'