test/tc_help.rb in gli-2.5.6 vs test/tc_help.rb in gli-2.6.0.rc1

- old
+ new

@@ -24,11 +24,13 @@ include GLI::App end test_that "the help command is configured properly when created" do Given { - @command = GLI::Commands::Help.new(TestApp.new,@output,@error) + app = TestApp.new + app.subcommand_option_handling :normal + @command = GLI::Commands::Help.new(app,@output,@error) } Then { assert_equal 'help',@command.name.to_s assert_nil @command.aliases assert_equal 'command',@command.arguments_description @@ -40,11 +42,13 @@ } end test_that "the help command can be configured to skip things declaratively" do Given { - @command = GLI::Commands::Help.new(TestApp.new,@output,@error) + app = TestApp.new + app.subcommand_option_handling :normal + @command = GLI::Commands::Help.new(app,@output,@error) GLI::Commands::Help.skips_pre = false GLI::Commands::Help.skips_post = false GLI::Commands::Help.skips_around = false } Then { @@ -57,11 +61,13 @@ test_that "the help command can be configured to skip things declaratively regardless of when it the object was created" do Given { GLI::Commands::Help.skips_pre = false GLI::Commands::Help.skips_post = false GLI::Commands::Help.skips_around = false - @command = GLI::Commands::Help.new(TestApp.new,@output,@error) + app = TestApp.new + app.subcommand_option_handling :normal + @command = GLI::Commands::Help.new(app,@output,@error) } Then { assert !@command.skips_pre assert !@command.skips_post assert !@command.skips_around @@ -153,10 +159,11 @@ test_that "omitting default_description doesn't blow up" do Given { app = TestApp.new app.instance_eval do + subcommand_option_handling :normal command :top do |top| top.command :list do |list| list.action do |g,o,a| end end @@ -199,9 +206,10 @@ ] @app = TestApp.new @app.instance_eval do program_desc program_description + subcommand_option_handling :normal unless omit_options flags.each do |(description,arg,flag_names)| desc description arg_name arg