make Page#data call safe
This commit is contained in:
+1
-1
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user