spec/clamp/option_spec.rb in jls-clamp-0.3.1 vs spec/clamp/option_spec.rb in jls-clamp-0.3.1.2

- old
+ new

@@ -143,7 +143,22 @@ end end end - + + describe "a required option" do + it "rejects :default" do + expect do + Clamp::Option.new("--key-file", "FILE", "SSH identity", + :required => true, :default => "hello") + end.to raise_error(ArgumentError) + end + + it "rejects :flag options" do + expect do + Clamp::Option.new("--awesome", :flag, "Be awesome?", :required => true) + end.to raise_error(ArgumentError) + end + end + end