brew/Library/Homebrew/test/test_requirement.rb
Jack Nagel fe4f39dcee Split up dependency test coverage
The DependencyCollector tests are really integration tests, while the
rest are closer to real unit tests. Split them up so that the tests can
be run in isolation on a per-class basis.
2013-01-13 21:01:15 -06:00

29 lines
746 B
Ruby

require 'testing_env'
require 'dependencies'
class RequirementTests < Test::Unit::TestCase
def test_accepts_single_tag
dep = Requirement.new("bar")
assert_equal %w{bar}, dep.tags
end
def test_accepts_multiple_tags
dep = Requirement.new(%w{bar baz})
assert_equal %w{bar baz}.sort, dep.tags.sort
dep = Requirement.new(*%w{bar baz})
assert_equal %w{bar baz}.sort, dep.tags.sort
end
def test_preserves_symbol_tags
dep = Requirement.new(:build)
assert_equal [:build], dep.tags
end
def test_accepts_symbol_and_string_tags
dep = Requirement.new([:build, "bar"])
assert_equal [:build, "bar"], dep.tags
dep = Requirement.new(:build, "bar")
assert_equal [:build, "bar"], dep.tags
end
end