test/test_command.rb in cri-2.3.0 vs test/test_command.rb in cri-2.4.0
- old
+ new
@@ -261,9 +261,22 @@
def test_help_for_bare_cmd
bare_cmd.help
end
+ def test_help_with_optional_options
+ cmd = Cri::Command.define do
+ name 'build'
+ flag :s, nil, 'short'
+ flag nil, :long, 'long'
+ end
+ help = cmd.help
+
+ assert_match(/--long.*-s/m, help)
+ assert_match(/^\e\[33m --long \e\[0mlong$/, help)
+ assert_match(/^\e\[33m -s \e\[0mshort$/, help)
+ end
+
def test_modify_with_block_argument
cmd = Cri::Command.define do |c|
c.name 'build'
end
assert_equal 'build', cmd.name