History

Update and fix manifest test

Dave Powers committed 2 years ago

Commit ed116eb1 parent 5ff242b3 files · +3 −3Browse files

Unified · Split

3 files
  1. lib/docs/core/manifest.rb +1 −1
  2. test/files/docs.json +1 −1
  3. test/lib/docs/core/manifest_test.rb +1 −1
lib/docs/core/manifest.rb+1−1
@@ -27,7 +27,7 @@ module Docs · 26 unmodified lines
2727 aliases = eval data.split("ALIASES = ").last.split(";").first
2828
2929 # set alias value
30− json["alias"] = aliases[json["slug"].to_sym]
30+ json["alias"] = aliases[json["slug"].try(:to_sym)]
3131
3232 result << json
3333 end
test/files/docs.json+1−1
@@ -1 +1 @@
1−[{"name":"CSS","slug":"css","type":"mdn","release":null,"mtime":1420139788,"db_size":3460507},{"name":"DOM","slug":"dom","type":"mdn","release":null,"mtime":1420139789,"db_size":11399128},{"name":"DOM Events","slug":"dom_events","type":"mdn","release":null,"mtime":1420139790,"db_size":889020},{"name":"HTML","slug":"html~5","type":"mdn","version":"5","mtime":1420139791,"db_size":1835647},{"name":"HTML","slug":"html~4","type":"mdn","version":"4","mtime":1420139790,"db_size":1835646},{"name":"HTTP","slug":"http","type":"rfc","release":null,"mtime":1420139790,"db_size":183083},{"name":"JavaScript","slug":"javascript","type":"mdn","release":null,"mtime":1420139791,"db_size":4125477}]
1+[{"name":"CSS","slug":"css","type":"mdn","release":null,"mtime":1420139788,"db_size":3460507,"alias":null},{"name":"DOM","slug":"dom","type":"mdn","release":null,"mtime":1420139789,"db_size":11399128,"alias":null},{"name":"DOM Events","slug":"dom_events","type":"mdn","release":null,"mtime":1420139790,"db_size":889020,"alias":null},{"name":"HTML","slug":"html~5","type":"mdn","version":"5","mtime":1420139791,"db_size":1835647,"alias":null},{"name":"HTML","slug":"html~4","type":"mdn","version":"4","mtime":1420139790,"db_size":1835646,"alias":null},{"name":"HTTP","slug":"http","type":"rfc","release":null,"mtime":1420139790,"db_size":183083,"alias":null},{"name":"JavaScript","slug":"javascript","type":"mdn","release":null,"mtime":1420139791,"db_size":4125477,"alias":"js"}]
test/lib/docs/core/manifest_test.rb+1−1
@@ -64,7 +64,7 @@ class ManifestTest < Minitest::Spec · 63 unmodified lines
6464 it "includes the doc's meta representation" do
6565 json = manifest.as_json
6666 assert_equal 1, json.length
67− assert_equal "{\"name\"=>\"Test\", \"db_size\"=>776533, :attribution=>\"foo\"}", json[0].to_s
67+ assert_equal "{\"name\"=>\"Test\", \"db_size\"=>776533, :attribution=>\"foo\", \"alias\"=>nil}", json[0].to_s
6868 end
6969 end
7070