diff --git a/lib/gollum/page.rb b/lib/gollum/page.rb index 0e83e360..602a0ca8 100644 --- a/lib/gollum/page.rb +++ b/lib/gollum/page.rb @@ -27,7 +27,7 @@ module Gollum # # Returns the String data. def data - self.blob.data + self.blob.data rescue nil end # Find a page in the given Gollum repo. diff --git a/test/test_page.rb b/test/test_page.rb index bfb74de8..07f3004e 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -5,6 +5,11 @@ context "Page" do @wiki = Gollum::Wiki.new(testpath("examples/lotr.git")) end + test "new page" do + page = Gollum::Page.new(@wiki) + assert_nil page.data + end + test "formatted page" do page = @wiki.formatted_page('Bilbo Baggins') assert_equal Gollum::Page, page.class