spec/book_manifest_spec.rb in softcover-0.6.5 vs spec/book_manifest_spec.rb in softcover-0.6.6
- old
+ new
@@ -46,13 +46,35 @@
before { Dir.chdir 'chapters' }
describe "finding the manifest in a higher directory" do
its(:title) { should eq "book" }
end
end
+
+
+ context "with mixed Markdown & PolyTeX files" do
+ before do
+ manifest.stub(:source_files).and_return(['foo.md', 'bar.tex'])
+ end
+
+ it "should have the right basenames" do
+ expect(manifest.basenames).to eq ['foo', 'bar']
+ end
+
+ it "should have the right extensions" do
+ expect(manifest.extensions).to eq ['.md', '.tex']
+ end
+
+ it "should have the right chapter objects" do
+ expect(manifest.chapter_objects[0].slug). to eq 'foo'
+ expect(manifest.chapter_objects[0].extension).to eq '.md'
+ expect(manifest.chapter_objects[1].slug). to eq 'bar'
+ expect(manifest.chapter_objects[1].extension).to eq '.tex'
+ end
+ end
end
context "in an invalid book directory" do
it "raises an error when manifest missing" do
expect{ subject }.to raise_error(Softcover::BookManifest::NotFound)
end
end
-end
\ No newline at end of file
+end