Output correct class name in custom inspect string

This commit is contained in:
Ashwin Maroli 2019-01-11 13:18:49 +05:30
parent 500dd64316
commit ae0a064f3f
4 changed files with 4 additions and 4 deletions

View File

@ -153,7 +153,7 @@ module Jekyll
#
# Returns the inspect string
def inspect
"#<Jekyll::Collection @label=#{label} docs=#{docs}>"
"#<#{self.class} @label=#{label} docs=#{docs}>"
end
# Produce a sanitized label name

View File

@ -295,7 +295,7 @@ module Jekyll
#
# Returns the inspect string for this document.
def inspect
"#<Jekyll::Document #{relative_path} collection=#{collection.label}>"
"#<#{self.class} #{relative_path} collection=#{collection.label}>"
end
# The string representation for this document.

View File

@ -77,7 +77,7 @@ module Jekyll
# Returns the shorthand String identifier of this doc.
def inspect
"<Excerpt: #{id}>"
"<#{self.class} id=#{id}>"
end
def output

View File

@ -69,7 +69,7 @@ class TestExcerpt < JekyllUnitTest
context "#inspect" do
should "contain the excerpt id as a shorthand string identifier" do
assert_equal @excerpt.inspect, "<Excerpt: #{@excerpt.id}>"
assert_equal @excerpt.inspect, "<#{@excerpt.class} id=#{@excerpt.id}>"
end
should "return a string" do