test/tc_help.rb in gli-2.5.4 vs test/tc_help.rb in gli-2.5.5
- old
+ new
@@ -149,9 +149,37 @@
refute_output_contained('GLOBAL OPTIONS')
assert_output_contained(/command \[command options\] \[arguments\.\.\.\]/)
}
end
+ test_that "omitting default_description doesn't blow up" do
+ Given {
+ app = TestApp.new
+ app.instance_eval do
+ command :top do |top|
+ top.command :list do |list|
+ list.action do |g,o,a|
+ end
+ end
+
+ top.command :new do |new|
+ new.action do |g,o,a|
+ end
+ end
+
+ top.default_command :list
+ end
+ end
+ @command = GLI::Commands::Help.new(app,@output,@error)
+ }
+ When {
+ @code = lambda { @command.execute({},{},['top']) }
+ }
+ Then {
+ assert_nothing_raised(&@code)
+ }
+ end
+
private
def a_GLI_app(omit_options=false)
lambda {
@program_description = program_description = any_desc