Interpolate Jekyll::Page subclass on inspection (#7203)

Merge pull request 7203
This commit is contained in:
Ashwin Maroli 2018-08-29 22:50:52 +05:30 committed by jekyllbot
parent 58f10f8e8a
commit 9f93fd092f
3 changed files with 5 additions and 5 deletions

View File

@ -161,7 +161,7 @@ module Jekyll
# Returns the object as a debug String.
def inspect
"#<Jekyll::Page @name=#{name.inspect}>"
"#<#{self.class} @name=#{name.inspect}>"
end
# Returns the Boolean of whether this Page is HTML or not.

View File

@ -10,9 +10,5 @@ module Jekyll
def read_yaml(*)
@data ||= {}
end
def inspect
"#<Jekyll:PageWithoutAFile @name=#{name.inspect}>"
end
end
end

View File

@ -33,6 +33,10 @@ class TestPageWithoutAFile < JekyllUnitTest
@page = setup_page("properties.html")
end
should "identify itself properly" do
assert_equal "#<Jekyll::PageWithoutAFile @name=\"properties.html\">", @page.inspect
end
should "not have page-content and page-data defined within it" do
assert_equal "pages", @page.type.to_s
assert_nil @page.content