diff options
| author | Jack Nagel | 2013-09-21 19:27:24 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-09-21 19:27:24 -0500 |
| commit | d2c4be9ebee74145ea7eb2f54273df1b5c29c1f0 (patch) | |
| tree | be3bd9304c3b407f5f933187eaf06bd7460ec0cf /Library/Homebrew/test | |
| parent | c6de3f78948dcd33a8ace236b60f58508e7d6b7d (diff) | |
| download | homebrew-d2c4be9ebee74145ea7eb2f54273df1b5c29c1f0.tar.bz2 | |
Move options to SoftwareSpec
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_software_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_software_spec.rb b/Library/Homebrew/test/test_software_spec.rb index febd33b39..c534cd008 100644 --- a/Library/Homebrew/test/test_software_spec.rb +++ b/Library/Homebrew/test/test_software_spec.rb @@ -29,6 +29,24 @@ class SoftwareSpecTests < Test::Unit::TestCase @spec.owner = owner @spec.resources.each_value { |r| assert_equal owner, r.owner } end + + def test_option + @spec.option('foo') + assert @spec.build.has_option? 'foo' + end + + def test_option_raises_when_begins_with_dashes + assert_raises(RuntimeError) { @spec.option('--foo') } + end + + def test_option_raises_when_name_empty + assert_raises(RuntimeError) { @spec.option('') } + end + + def test_option_accepts_symbols + @spec.option(:foo) + assert @spec.build.has_option? 'foo' + end end class HeadSoftwareSpecTests < Test::Unit::TestCase |
