| @@ -57,9 +57,10 @@ class ManifestTest < MiniTest::Spec · 56 unmodified lines |
| 57 | assert_instance_of Array, manifest.as_json | 57 | assert_instance_of Array, manifest.as_json |
| 58 | end | 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 | before do | 61 | before do |
| 62 | stub(store).exist?(index_path) { true } | 62 | stub(store).exist?(index_path) { true } |
| | 63 | stub(store).exist?(db_path) { true } |
| 63 | end | 64 | end |
| 64 | | 65 | |
| 65 | it "includes the doc's JSON representation" do | 66 | it "includes the doc's JSON representation" do |
| @@ -77,10 +78,19 @@ class ManifestTest < MiniTest::Spec · 11 unmodified lines |
| 77 | | 78 | |
| 78 | context "when the doc doesn't have an index" do | 79 | context "when the doc doesn't have an index" do |
| 79 | it "doesn't include the doc" do | 80 | it "doesn't include the doc" do |
| | 81 | stub(store).exist?(db_path) { true } |
| 80 | stub(store).exist?(index_path) { false } | 82 | stub(store).exist?(index_path) { false } |
| 81 | assert_empty manifest.as_json | 83 | assert_empty manifest.as_json |
| 82 | end | 84 | end |
| 83 | end | 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 | end | 94 | end |
| 85 | | 95 | |
| 86 | describe "#to_json" do | 96 | describe "#to_json" do |