From f1f2e24aec567126eae93b0706579911240001c8 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sun, 25 Feb 2024 14:23:21 -0800 Subject: [PATCH] test fixture: pretty print JSON for readability --- .../api/internal_tap_json/formula_spec.rb | 2 +- .../internal_tap_json/homebrew-core.json | 117 +++++++++++++++++- 2 files changed, 117 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb b/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb index 39112a8ee6..d664135160 100644 --- a/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb +++ b/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb @@ -20,7 +20,7 @@ RSpec.describe "Internal Tap JSON -- Formula" do api_hash = CoreTap.instance.to_api_hash api_hash["tap_git_head"] = tap_git_head # tricky to mock - expect(JSON.generate(api_hash)).to eq(internal_tap_json) + expect(JSON.pretty_generate(api_hash)).to eq(internal_tap_json) end end diff --git a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json index 0de2d1515e..c823e3973f 100644 --- a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json +++ b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json @@ -1 +1,116 @@ -{"tap_git_head":"9977471165641744a829d3e494fa563407503297","aliases":{"fennel-lang":"fennel","ponyc-lang":"ponyc"},"renames":{"advancemenu":"advancemame","amtk":"libgedit-amtk","annie":"lux","antlr2":"antlr@2","romanesco":"fennel"},"tap_migrations":{"adobe-air-sdk":"homebrew/cask","android-ndk":"homebrew/cask","android-platform-tools":"homebrew/cask","android-sdk":"homebrew/cask","app-engine-go-32":"homebrew/cask/google-cloud-sdk"},"formulae":{"fennel":{"desc":"Lua Lisp Language","license":"MIT","homepage":"https://fennel-lang.org","urls":{"stable":{"url":"https://github.com/bakpakin/Fennel/archive/refs/tags/1.4.0.tar.gz","checksum":"161eb7f17f86e95de09070214d042fb25372f71ad266f451431f3109e87965c7"}},"post_install_defined":false,"ruby_source_path":"Formula/f/fennel.rb","ruby_source_sha256":"5856e655fd1cea11496d67bc27fb14fee5cfbdea63c697c3773c7f247581197d","dependencies":["lua"],"version":"1.4.0","bottle":{"files":{"all":{"cellar":":any_skip_relocation","sha256":"f46028597883cbc38864c61bd3fa402da9cb90ce97415d51a7b5279bc17f7bd0"}}}},"ponyc":{"desc":"Object-oriented, actor-model, capabilities-secure programming language","license":"BSD-2-Clause","homepage":"https://www.ponylang.io/","urls":{"stable":{"url":"https://github.com/ponylang/ponyc.git","tag":"0.58.1","revision":"fe3895eb4af494bf36d7690641bdfb5755db8350"}},"post_install_defined":false,"ruby_source_path":"Formula/p/ponyc.rb","ruby_source_sha256":"81d51c25d18710191beb62f9f380bae3d878aad815a65ec1ee2a3b132c1fadb3","build_dependencies":["cmake","python@3.12"],"uses_from_macos":[{"llvm":["build","test"]},"zlib"],"uses_from_macos_bounds":[{},{}],"version":"0.58.1","bottle":{"files":{"arm64_sonoma":{"cellar":":any_skip_relocation","sha256":"e3aecfcf02aea56d53d82691e2ad7a780f771023d7070271bfce96b17439a34d"},"arm64_ventura":{"cellar":":any_skip_relocation","sha256":"6ff83717191e16e4f852fb3be8f838afba312cc39e601bb5cebd2a618a328658"},"arm64_monterey":{"cellar":":any_skip_relocation","sha256":"25c91bce200583a96f4cea34f31393c8f10eadcab363cc7d4d864d15f5f97e25"},"sonoma":{"cellar":":any_skip_relocation","sha256":"5f4c550ce33e2970e0ada18a409755fa62936181289a21c15582ff80343866b6"},"ventura":{"cellar":":any_skip_relocation","sha256":"f26c799f45013685da779bf2008ebe1907f9b3a93d5f260ce271a3f3b628da50"},"monterey":{"cellar":":any_skip_relocation","sha256":"1cff10d068b36b18b253d235424c4f5aef71ff9ee44f2522c4b041dd4383ec30"},"x86_64_linux":{"cellar":":any_skip_relocation","sha256":"ab49318d75eed3ee932c8e5add22f252ec0c852aad94945022877f926e93899f"}}}}}} +{ + "tap_git_head": "9977471165641744a829d3e494fa563407503297", + "aliases": { + "fennel-lang": "fennel", + "ponyc-lang": "ponyc" + }, + "renames": { + "advancemenu": "advancemame", + "amtk": "libgedit-amtk", + "annie": "lux", + "antlr2": "antlr@2", + "romanesco": "fennel" + }, + "tap_migrations": { + "adobe-air-sdk": "homebrew/cask", + "android-ndk": "homebrew/cask", + "android-platform-tools": "homebrew/cask", + "android-sdk": "homebrew/cask", + "app-engine-go-32": "homebrew/cask/google-cloud-sdk" + }, + "formulae": { + "fennel": { + "desc": "Lua Lisp Language", + "license": "MIT", + "homepage": "https://fennel-lang.org", + "urls": { + "stable": { + "url": "https://github.com/bakpakin/Fennel/archive/refs/tags/1.4.0.tar.gz", + "checksum": "161eb7f17f86e95de09070214d042fb25372f71ad266f451431f3109e87965c7" + } + }, + "post_install_defined": false, + "ruby_source_path": "Formula/f/fennel.rb", + "ruby_source_sha256": "5856e655fd1cea11496d67bc27fb14fee5cfbdea63c697c3773c7f247581197d", + "dependencies": [ + "lua" + ], + "version": "1.4.0", + "bottle": { + "files": { + "all": { + "cellar": ":any_skip_relocation", + "sha256": "f46028597883cbc38864c61bd3fa402da9cb90ce97415d51a7b5279bc17f7bd0" + } + } + } + }, + "ponyc": { + "desc": "Object-oriented, actor-model, capabilities-secure programming language", + "license": "BSD-2-Clause", + "homepage": "https://www.ponylang.io/", + "urls": { + "stable": { + "url": "https://github.com/ponylang/ponyc.git", + "tag": "0.58.1", + "revision": "fe3895eb4af494bf36d7690641bdfb5755db8350" + } + }, + "post_install_defined": false, + "ruby_source_path": "Formula/p/ponyc.rb", + "ruby_source_sha256": "81d51c25d18710191beb62f9f380bae3d878aad815a65ec1ee2a3b132c1fadb3", + "build_dependencies": [ + "cmake", + "python@3.12" + ], + "uses_from_macos": [ + { + "llvm": [ + "build", + "test" + ] + }, + "zlib" + ], + "uses_from_macos_bounds": [ + { + }, + { + } + ], + "version": "0.58.1", + "bottle": { + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "sha256": "e3aecfcf02aea56d53d82691e2ad7a780f771023d7070271bfce96b17439a34d" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "sha256": "6ff83717191e16e4f852fb3be8f838afba312cc39e601bb5cebd2a618a328658" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "sha256": "25c91bce200583a96f4cea34f31393c8f10eadcab363cc7d4d864d15f5f97e25" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "sha256": "5f4c550ce33e2970e0ada18a409755fa62936181289a21c15582ff80343866b6" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "sha256": "f26c799f45013685da779bf2008ebe1907f9b3a93d5f260ce271a3f3b628da50" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "sha256": "1cff10d068b36b18b253d235424c4f5aef71ff9ee44f2522c4b041dd4383ec30" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "sha256": "ab49318d75eed3ee932c8e5add22f252ec0c852aad94945022877f926e93899f" + } + } + } + } + } +} \ No newline at end of file