Implement Action#input, delegating to env input
This commit is contained in:
parent
a871bb4009
commit
70109615c8
@ -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
|
||||
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user