Skip to content

Commit

Permalink
Parent stacks command only allowing one parent (#208)
Browse files Browse the repository at this point in the history
Add --parents option for multiple parent stacks.
  • Loading branch information
jfarrell authored and askreet committed Apr 3, 2017
1 parent d0f1f30 commit 7df2554
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/moonshot/commands/parent_stack_option.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ def parser
'Parent stack to import parameters from') do |v|
Moonshot.config.parent_stacks = [v]
end

parser.on('--parents a,b,c', Array,
'List of parent stacks to import parameters from') do |v|
Moonshot.config.parent_stacks = v
end
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions spec/moonshot/commands/create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@
expect(subject.deploy).to eq(false)
expect(Moonshot.config.parameter_overrides).to match('Key' => 'Value')
end

it 'should process multiple parent stacks' do
op = subject.parser
op.parse(%w(--parents parent1,parent2,parent3 --no-deploy))
expect(subject.deploy).to eq(false)
expect(Moonshot.config.parent_stacks.count).to be(3)
end
end

0 comments on commit 7df2554

Please sign in to comment.