aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMike McQuaid2016-11-21 18:45:20 +0000
committerGitHub2016-11-21 18:45:20 +0000
commitc3f959d6af36f075600aac63f208d59c30cd602c (patch)
tree336233a927c2be8b69f74dd704b73b3293d6ac33 /Library/Homebrew/test
parentc7267b123d38d1c96c2ca786c942255d2417cd86 (diff)
parentd07b9ed7f2e8806b1840b4f60605ef45487655e1 (diff)
downloadbrew-c3f959d6af36f075600aac63f208d59c30cd602c.tar.bz2
Merge pull request #1542 from woodruffw/deprecate-utils-json
compat: deprecate Utils::JSON in favor of corelib JSON.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/json_test.rb8
-rw-r--r--Library/Homebrew/test/support/helper/integration_command_test_case.rb2
-rw-r--r--Library/Homebrew/test/tab_test.rb2
3 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/test/json_test.rb b/Library/Homebrew/test/json_test.rb
index 14d2f2b4c..7c4c3671d 100644
--- a/Library/Homebrew/test/json_test.rb
+++ b/Library/Homebrew/test/json_test.rb
@@ -1,20 +1,20 @@
require "testing_env"
-require "utils/json"
+require "json"
class JsonSmokeTest < Homebrew::TestCase
def test_encode
hash = { "foo" => ["bar", "baz"] }
json = '{"foo":["bar","baz"]}'
- assert_equal json, Utils::JSON.dump(hash)
+ assert_equal json, JSON.generate(hash)
end
def test_decode
hash = { "foo" => ["bar", "baz"], "qux" => 1 }
json = '{"foo":["bar","baz"],"qux":1}'
- assert_equal hash, Utils::JSON.load(json)
+ assert_equal hash, JSON.parse(json)
end
def test_decode_failure
- assert_raises(Utils::JSON::Error) { Utils::JSON.load("nope") }
+ assert_raises(JSON::ParserError) { JSON.parse("nope") }
end
end
diff --git a/Library/Homebrew/test/support/helper/integration_command_test_case.rb b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
index 5940fd84b..b79fdd6e0 100644
--- a/Library/Homebrew/test/support/helper/integration_command_test_case.rb
+++ b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
@@ -185,7 +185,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
cmd("install", old_name)
(core_tap.path/"Formula/#{old_name}.rb").unlink
formula_renames = core_tap.path/"formula_renames.json"
- formula_renames.write Utils::JSON.dump(old_name => new_name)
+ formula_renames.write JSON.generate(old_name => new_name)
core_tap.path.cd do
shutup do
diff --git a/Library/Homebrew/test/tab_test.rb b/Library/Homebrew/test/tab_test.rb
index 76c9aacc9..ef653103c 100644
--- a/Library/Homebrew/test/tab_test.rb
+++ b/Library/Homebrew/test/tab_test.rb
@@ -186,7 +186,7 @@ class TabTests < Homebrew::TestCase
end
def test_to_json
- tab = Tab.new(Utils::JSON.load(@tab.to_json))
+ tab = Tab.new(JSON.parse(@tab.to_json))
assert_equal @tab.used_options.sort, tab.used_options.sort
assert_equal @tab.unused_options.sort, tab.unused_options.sort
assert_equal @tab.built_as_bottle, tab.built_as_bottle