spec/finder_spec.rb in spandex-0.0.3 vs spec/finder_spec.rb in spandex-0.0.4
- old
+ new
@@ -132,10 +132,17 @@
create_file("stuff.md")
page = make_finder.get("stuff")
page.should_not be_nil
end
+ it "can have a leading /" do
+ create_file("stuff.md")
+ page = make_finder.get("/stuff")
+ page.should_not be_nil
+ end
+
+
it "finds the first file tilt knows" do
create_file("stuff.snoogledoobers")
create_file("stuff.md")
page = make_finder.get("stuff")
page.extension.should == "md"
@@ -172,12 +179,20 @@
it "doesn't create a separate cache entry for trailing slashes" do
create_file("stuff.md")
finder = make_finder
finder.all_pages
finder.get("stuff/")
+ finder.all_pages.size.should == 1
+ end
+ it "doesn't create a separate cache entry for leading slashes" do
+ create_file("stuff.md")
+ finder = make_finder
+ finder.get("stuff")
+ finder.get("/stuff")
finder.all_pages.size.should == 1
end
+
end
context "when loading by filename" do
it "does in fact load something" do