aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2014-06-29 22:18:44 -0500
committerJack Nagel2014-06-29 22:18:44 -0500
commit00f2f74addff80341c714c458d1c325c831d8fdc (patch)
tree9d8e90aab2422ec940e54e44b1bbc5ab424c2380 /Library/Homebrew/test
parent4c50a7b167f74d9ec6442d59dd0497e42719e66b (diff)
downloadhomebrew-00f2f74addff80341c714c458d1c325c831d8fdc.tar.bz2
Test that the tab round-trips through JSON
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_tab.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/test/test_tab.rb b/Library/Homebrew/test/test_tab.rb
index 7d4406e73..ccea2b1be 100644
--- a/Library/Homebrew/test/test_tab.rb
+++ b/Library/Homebrew/test/test_tab.rb
@@ -9,15 +9,15 @@ class TabTests < Homebrew::TestCase
@unused << Option.new("with-baz") << Option.new("without-qux")
@tab = Tab.new({
- :used_options => @used,
- :unused_options => @unused,
+ :used_options => @used.map(&:to_s),
+ :unused_options => @unused.map(&:to_s),
:built_as_bottle => false,
:poured_from_bottle => true,
:tapped_from => "Homebrew/homebrew",
:time => nil,
:HEAD => TEST_SHA1,
- :compiler => :clang,
- :stdlib => :libcxx,
+ :compiler => "clang",
+ :stdlib => "libcxx",
})
end
@@ -50,6 +50,7 @@ class TabTests < Homebrew::TestCase
def test_universal?
refute_predicate @tab, :universal?
@used << "universal"
+ @tab.used_options = @used.map(&:to_s)
assert_predicate @tab, :universal?
end
@@ -85,6 +86,10 @@ class TabTests < Homebrew::TestCase
assert_equal :clang, tab.cxxstdlib.compiler
assert_equal :libcxx, tab.cxxstdlib.type
end
+
+ def test_to_json
+ assert_equal @tab, Tab.new(Utils::JSON.load(@tab.to_json))
+ end
end
class TabLoadingTests < Homebrew::TestCase