Add option_name tests.

This commit is contained in:
Mike McQuaid 2015-12-14 19:39:49 +00:00
parent a4a2b305f2
commit 7095378b31
3 changed files with 15 additions and 0 deletions

View File

@ -20,6 +20,7 @@ class BuildOptionsTests < Homebrew::TestCase
assert @build.with?("bar")
assert @build.with?("baz")
assert @build.without?("qux")
assert @build.without?("xyz")
end
def test_used_options

View File

@ -52,3 +52,10 @@ class DependencyTests < Homebrew::TestCase
refute_eql foo1, foo3
end
end
class TapDependencyTests < Homebrew::TestCase
def test_option_name
dep = TapDependency.new("foo/bar/dog")
assert_equal "dog", dep.option_name
end
end

View File

@ -2,6 +2,8 @@ require "testing_env"
require "requirement"
class RequirementTests < Homebrew::TestCase
class TestRequirement < Requirement; end
def test_accepts_single_tag
dep = Requirement.new(%w[bar])
assert_equal %w[bar], dep.tags
@ -12,6 +14,11 @@ class RequirementTests < Homebrew::TestCase
assert_equal %w[bar baz].sort, dep.tags.sort
end
def test_option_name
dep = TestRequirement.new
assert_equal "test", dep.option_name
end
def test_preserves_symbol_tags
dep = Requirement.new([:build])
assert_equal [:build], dep.tags