Unified · Split
| @@ -27,7 +27,7 @@ module Docs · 26 unmodified lines | ||
| 27 | 27 | |
| 28 | 28 | def indexed_docs |
| 29 | 29 | @docs.select do |doc| |
| 30 | − @store.exist? doc.index_path | |
| 30 | + @store.exist?(doc.index_path) && @store.exist?(doc.db_path) | |
| 31 | 31 | end |
| 32 | 32 | end |
| 33 | 33 | end |
| @@ -57,9 +57,10 @@ class ManifestTest < MiniTest::Spec · 56 unmodified lines | ||
| 57 | 57 | assert_instance_of Array, manifest.as_json |
| 58 | 58 | end |
| 59 | 59 | |
| 60 | − context "when the doc has an index" do | |
| 60 | + context "when the doc has an index and a db" do | |
| 61 | 61 | before do |
| 62 | 62 | stub(store).exist?(index_path) { true } |
| 63 | + stub(store).exist?(db_path) { true } | |
| 63 | 64 | end |
| 64 | 65 | |
| 65 | 66 | it "includes the doc's JSON representation" do |
| @@ -77,10 +78,19 @@ class ManifestTest < MiniTest::Spec · 11 unmodified lines | ||
| 77 | 78 | |
| 78 | 79 | context "when the doc doesn't have an index" do |
| 79 | 80 | it "doesn't include the doc" do |
| 81 | + stub(store).exist?(db_path) { true } | |
| 80 | 82 | stub(store).exist?(index_path) { false } |
| 81 | 83 | assert_empty manifest.as_json |
| 82 | 84 | end |
| 83 | 85 | end |
| 86 | + | |
| 87 | + context "when the doc doesn't have a db" do | |
| 88 | + it "doesn't include the doc" do | |
| 89 | + stub(store).exist?(index_path) { true } | |
| 90 | + stub(store).exist?(db_path) { false } | |
| 91 | + assert_empty manifest.as_json | |
| 92 | + end | |
| 93 | + end | |
| 84 | 94 | end |
| 85 | 95 | |
| 86 | 96 | describe "#to_json" do |