Skip to content
Browse files

add spec example for github issue #8

  • Loading branch information...
1 parent 5b38413 commit 62a997817c5bd310db8140a223a97f7e214e6e45 Gabriel Gilder committed Aug 8, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 spec/runner_spec.rb
View
16 spec/runner_spec.rb
@@ -223,6 +223,22 @@
global_option.should == 'bar'
end
+
+ it 'should allow global arguments with values before command arguments (github issue #8)' do
+ global_option = nil
+ command_option = nil
+ new_command_runner('foo', '--config', 'path', 'bar') do
+ global_option('--config VALUE') { |v| global_option = v }
+
+ command :foo do |c|
+ c.option('bar') { command_option = 'bar' }
+ c.when_called {}
+ end
+ end.run!
+
+ global_option.should == 'path'
+ command_option.should == 'bar'
+ end
end

0 comments on commit 62a9978

Please sign in to comment.
Something went wrong with that request. Please try again.