Przeglądaj źródła

Generate pretty JSON in docs.json manifest

To make it easier to track changes in Git.
Thibaut Courouble 7 lat temu
rodzic
commit
68b80bce36
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      lib/docs/core/manifest.rb
  2. 1 1
      test/lib/docs/core/manifest_test.rb

+ 1 - 1
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

+ 1 - 1
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