History

Make docs mtime the greatest of the index and db files' mtime

Thibaut committed 11 years ago

Commit bc5488f1 parent ca7ff602 files · +13 −5Browse files

Showing the changes to test (1 of 2 files). Show all

Unified · Split

test/lib/docs/core/manifest_test.rb+8−4
@@ -69,10 +69,14 @@ class ManifestTest < MiniTest::Spec · 68 unmodified lines
69 assert_empty doc.as_json.keys - json.first.keys69 assert_empty doc.as_json.keys - json.first.keys
70 end70 end
71 71
72 it "adds an :mtime attribute" do72 it "adds an :mtime attribute with the greatest of the index and db files' mtime" do
73 mtime = Time.now - 173 mtime_index = Time.now - 1
74 stub(store).mtime(index_path) { mtime }74 mtime_db = Time.now - 2
75 assert_equal mtime.to_i, manifest.as_json.first[:mtime]75 stub(store).mtime(index_path) { mtime_index }
76 stub(store).mtime(db_path) { mtime_db }
77 assert_equal mtime_index.to_i, manifest.as_json.first[:mtime]
78 mtime_index, mtime_db = mtime_db, mtime_index
79 assert_equal mtime_db.to_i, manifest.as_json.first[:mtime]
76 end80 end
77 end81 end
78 82