diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-12 20:49:18 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-13 13:22:24 -0700 |
| commit | cc0f4141e17939bdfa4e8e6f84921161041507ef (patch) | |
| tree | f608cafae947b5c602ca7d9e02349e2c3eec4ae0 /spec | |
| parent | e852580cc09ebead2ef1f8d385338ebea645308a (diff) | |
| download | puppet-cc0f4141e17939bdfa4e8e6f84921161041507ef.tar.gz puppet-cc0f4141e17939bdfa4e8e6f84921161041507ef.tar.xz puppet-cc0f4141e17939bdfa4e8e6f84921161041507ef.zip | |
maint: ensure we handle '-foo=' options correctly in faces.
This is legal, and defines an option with an argument for optparse; we want to
make sure that we stay consistent with that in our code handling the same sort
of inputs.
This also adds a framework for later testing any other strange naming bits and
bobs we find around option handling.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/shared_behaviours/things_that_declare_options.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/shared_behaviours/things_that_declare_options.rb b/spec/shared_behaviours/things_that_declare_options.rb index 1b41c2279..f7512dec0 100755 --- a/spec/shared_behaviours/things_that_declare_options.rb +++ b/spec/shared_behaviours/things_that_declare_options.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- shared_examples_for "things that declare options" do it "should support options without arguments" do subject = add_options_to { option "--bar" } @@ -15,6 +14,13 @@ shared_examples_for "things that declare options" do subject.should be_option :foo end + { "--foo=" => :foo }.each do |input, option| + it "should accept #{name.inspect}" do + subject = add_options_to { option input } + subject.should be_option option + end + end + it "should support option documentation" do text = "Sturm und Drang (German pronunciation: [ˈʃtʊʁm ʊnt ˈdʁaŋ]) …" |
