make Page#data call safe
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ module Gollum
|
|||||||
#
|
#
|
||||||
# Returns the String data.
|
# Returns the String data.
|
||||||
def data
|
def data
|
||||||
self.blob.data
|
self.blob.data rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find a page in the given Gollum repo.
|
# Find a page in the given Gollum repo.
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ context "Page" do
|
|||||||
@wiki = Gollum::Wiki.new(testpath("examples/lotr.git"))
|
@wiki = Gollum::Wiki.new(testpath("examples/lotr.git"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "new page" do
|
||||||
|
page = Gollum::Page.new(@wiki)
|
||||||
|
assert_nil page.data
|
||||||
|
end
|
||||||
|
|
||||||
test "formatted page" do
|
test "formatted page" do
|
||||||
page = @wiki.formatted_page('Bilbo Baggins')
|
page = @wiki.formatted_page('Bilbo Baggins')
|
||||||
assert_equal Gollum::Page, page.class
|
assert_equal Gollum::Page, page.class
|
||||||
|
|||||||
Reference in New Issue
Block a user