test/test_command_dsl.rb in cri-2.0b1 vs test/test_command_dsl.rb in cri-2.0rc1
- old
+ new
@@ -29,12 +29,12 @@
assert_equal :probably, $did_it_work
# Check
assert_equal 'moo', command.name
assert_equal 'dunno whatever', command.usage
- assert_equal 'does stuff', command.short_desc
- assert_equal 'This command does a lot of stuff.', command.long_desc
+ assert_equal 'does stuff', command.summary
+ assert_equal 'This command does a lot of stuff.', command.description
# Check options
expected_option_definitions = Set.new([
{ :short => 'a', :long => 'aaa', :desc => 'opt a', :argument => :optional, :block => nil },
{ :short => 'b', :long => 'bbb', :desc => 'opt b', :argument => :required, :block => nil },
@@ -59,8 +59,20 @@
# Check
assert_equal 'super', command.name
assert_equal 1, command.subcommands.size
assert_equal 'sub', command.subcommands.to_a[0].name
+ end
+
+ def test_aliases
+ # Define
+ dsl = Cri::CommandDSL.new
+ dsl.instance_eval do
+ aliases :moo, :aah
+ end
+ command = dsl.command
+
+ # Check
+ assert_equal %w( aah moo ), command.aliases.sort
end
end