Commit 8584bffa authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Create] Use #remainder! to clear all remaining args

parent 767c1507
...@@ -30,8 +30,8 @@ module Pod ...@@ -30,8 +30,8 @@ module Pod
def initialize(argv) def initialize(argv)
@name = argv.shift_argument @name = argv.shift_argument
@template_url = argv.option('template-url', TEMPLATE_REPO) @template_url = argv.option('template-url', TEMPLATE_REPO)
@additional_args = argv.remainder
super super
@additional_args = argv.remainder!
end end
def validate! def validate!
......
...@@ -25,13 +25,13 @@ module Pod ...@@ -25,13 +25,13 @@ module Pod
run_command('lib', 'create', 'TestPod') run_command('lib', 'create', 'TestPod')
end end
it 'configures the template after cloning it passing the name of the Pod as the argument' do it 'configures the template after cloning it passing the name of the Pod and any other args as the argument' do
@sut.any_instance.stubs(:clone_template) @sut.any_instance.stubs(:clone_template)
dir = SpecHelper.temporary_directory + 'TestPod' dir = SpecHelper.temporary_directory + 'TestPod'
dir.mkpath dir.mkpath
File.stubs(:exist?).with('configure').returns(true) File.stubs(:exist?).with('configure').returns(true)
@sut.any_instance.expects(:system).with('./configure TestPod').once @sut.any_instance.expects(:system).with('./configure', 'TestPod', 'foo').once
run_command('lib', 'create', 'TestPod') run_command('lib', 'create', 'TestPod', 'foo', '--verbose')
end end
it 'should show link to new pod guide after creation' do it 'should show link to new pod guide after creation' do
...@@ -48,7 +48,7 @@ module Pod ...@@ -48,7 +48,7 @@ module Pod
it 'should use the given template URL' do it 'should use the given template URL' do
template_url = 'https://github.com/custom/template.git' template_url = 'https://github.com/custom/template.git'
@sut.any_instance.expects(:git!).with(['clone', template_url, 'TestPod']).once @sut.any_instance.expects(:git!).with(['clone', template_url, 'TestPod']).once
run_command('lib', 'create', 'TestPod', template_url) run_command('lib', 'create', 'TestPod', "--template-url=#{template_url}")
end end
it 'should use the default URL if no template URL is given' do it 'should use the default URL if no template URL is given' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment