Add tests for Tab versions

This commit is contained in:
Vlad Shablinsky 2016-07-27 17:44:16 +03:00 committed by Xu Cheng
parent 42bc623a27
commit 1114219384
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE
2 changed files with 20 additions and 1 deletions

View File

@ -16,6 +16,11 @@
"source": {
"path": "/usr/local/Library/Taps/hombrew/homebrew-core/Formula/foo.rb",
"tap": "homebrew/core",
"spec": "stable"
"spec": "stable",
"versions": {
"stable": "2.14",
"devel": "2.15",
"head": "HEAD-0000000"
}
}
}

View File

@ -20,6 +20,11 @@ class TabTests < Homebrew::TestCase
"tap" => "homebrew/core",
"path" => nil,
"spec" => "stable",
"versions" => {
"stable" => "0.10",
"devel" => "0.14",
"head" => "HEAD-1111111",
}
})
end
@ -35,6 +40,9 @@ class TabTests < Homebrew::TestCase
assert_nil tab.tap
assert_nil tab.time
assert_nil tab.HEAD
assert_nil tab.stable_version
assert_nil tab.devel_version
assert_nil tab.head_version
assert_equal DevelopmentTools.default_compiler, tab.cxxstdlib.compiler
assert_nil tab.cxxstdlib.type
end
@ -105,6 +113,9 @@ class TabTests < Homebrew::TestCase
assert_equal TEST_SHA1, tab.HEAD
assert_equal :clang, tab.cxxstdlib.compiler
assert_equal :libcxx, tab.cxxstdlib.type
assert_equal "2.14", tab.stable_version.to_s
assert_equal "2.15", tab.devel_version.to_s
assert_equal "HEAD-0000000", tab.head_version.to_s
end
def test_to_json
@ -119,6 +130,9 @@ class TabTests < Homebrew::TestCase
assert_equal @tab.HEAD, tab.HEAD
assert_equal @tab.compiler, tab.compiler
assert_equal @tab.stdlib, tab.stdlib
assert_equal @tab.stable_version, tab.stable_version
assert_equal @tab.devel_version, tab.devel_version
assert_equal @tab.head_version, tab.head_version
end
def test_remap_deprecated_options