소스 검색

Generate pretty JSON in docs.json manifest

To make it easier to track changes in Git.
Thibaut Courouble 7 년 전
부모
커밋
68b80bce36
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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