diff options
author | Chris Roberts <chrisroberts.code@gmail.com> | 2013-11-15 09:18:05 -0800 |
---|---|---|
committer | Chris Roberts <chrisroberts.code@gmail.com> | 2013-11-15 09:18:05 -0800 |
commit | 0188add60a63bad6ec21459f46e071c3d6c91738 (patch) | |
tree | c5d34dabac8e9dc7cfe137a343d76a80e2f20021 /spec | |
parent | 47a51f58bf8f84718e6cc2dbeaf21028b4d711d3 (diff) | |
download | mixlib-cli-0188add60a63bad6ec21459f46e071c3d6c91738.tar.gz |
Include spec test with array default value
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mixlib/cli_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/mixlib/cli_spec.rb b/spec/mixlib/cli_spec.rb index 9175506..662de26 100644 --- a/spec/mixlib/cli_spec.rb +++ b/spec/mixlib/cli_spec.rb @@ -239,7 +239,7 @@ describe Mixlib::CLI do before do TestCLI.options = {:arg1 => {:boolean => true}} end - + it "should retain previously defined options from parent" do class T1 < TestCLI option :arg2, :boolean => true @@ -269,6 +269,18 @@ describe Mixlib::CLI do T4.options["arg#{i + 1}".to_sym].should be_a(Hash) end end + + it "should also work with an option that's an array" do + class T5 < TestCLI + option :arg2, :default => [] + end + + class T6 < T5 + end + + T6.options[:arg2].should be_a(Hash) + end + end end |