From 68b80bce369b55242483e8f40cdd5bf631628753 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 25 Mar 2018 16:27:53 -0400 Subject: [PATCH] Generate pretty JSON in docs.json manifest To make it easier to track changes in Git. --- lib/docs/core/manifest.rb | 2 +- test/lib/docs/core/manifest_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/docs/core/manifest.rb b/lib/docs/core/manifest.rb index cc7ff49f..624d2b81 100644 --- a/lib/docs/core/manifest.rb +++ b/lib/docs/core/manifest.rb @@ -21,7 +21,7 @@ module Docs end def to_json - JSON.generate(as_json) + JSON.pretty_generate(as_json) end end end diff --git a/test/lib/docs/core/manifest_test.rb b/test/lib/docs/core/manifest_test.rb index 56c9d416..16484a70 100644 --- a/test/lib/docs/core/manifest_test.rb +++ b/test/lib/docs/core/manifest_test.rb @@ -78,7 +78,7 @@ class ManifestTest < MiniTest::Spec describe "#to_json" do it "returns the JSON string for #as_json" do stub(manifest).as_json { { test: 'ok' } } - assert_equal '{"test":"ok"}', manifest.to_json + assert_equal "{\n \"test\": \"ok\"\n}", manifest.to_json end end end