Allow Env constructor to accept a remote instance
This commit is contained in:
parent
00d9b074cd
commit
88036f0389
@ -4,10 +4,11 @@ module Producer
|
|||||||
attr_reader :input, :output, :registry
|
attr_reader :input, :output, :registry
|
||||||
attr_accessor :target
|
attr_accessor :target
|
||||||
|
|
||||||
def initialize(input: $stdin, output: $stdout, registry: {})
|
def initialize(input: $stdin, output: $stdout, remote: nil, registry: {})
|
||||||
@input = input
|
@input = input
|
||||||
@output = output
|
@output = output
|
||||||
@registry = registry
|
@registry = registry
|
||||||
|
@remote = remote
|
||||||
@target = nil
|
@target = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -38,6 +38,15 @@ module Producer::Core
|
|||||||
expect(env.output).to be output
|
expect(env.output).to be output
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when remote is given as argument' do
|
||||||
|
let(:remote) { double 'remote' }
|
||||||
|
subject(:env) { described_class.new(remote: remote) }
|
||||||
|
|
||||||
|
it 'assigns the given remote' do
|
||||||
|
expect(env.remote).to be remote
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#target' do
|
describe '#target' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user