Files
boxen/test/boxen_cli_test.rb
Yossef Mendelssohn ce4f86f35c Don't abort for help display
`abort` is a quick way to print-and-quit, but asking for help isn't the
same as the command failing.
2012-10-11 11:59:40 -04:00

40 lines
780 B
Ruby

require "boxen/test"
require "boxen/cli"
class BoxenCLITest < Boxen::Test
def setup
@config = Boxen::Config.new
@flags = Boxen::Flags.new
@cli = Boxen::CLI.new(@config, @flags)
end
def test_initialize
config = Boxen::Config.new
flags = Boxen::Flags.new
cli = Boxen::CLI.new config, flags
assert_equal config, cli.config
assert_equal flags, cli.flags
assert_equal config, cli.runner.config
assert_equal flags, cli.runner.flags
end
def test_run
@cli.runner.expects(:run)
@cli.run
end
def test_help
$stdout.stubs(:write)
flags = Boxen::Flags.new('--help')
cli = Boxen::CLI.new(@config, flags)
cli.runner.expects(:run).never
assert_raises SystemExit do
cli.run
end
end
end