Output correct class name in custom inspect string
This commit is contained in:
parent
500dd64316
commit
ae0a064f3f
|
|
@ -153,7 +153,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns the inspect string
|
# Returns the inspect string
|
||||||
def inspect
|
def inspect
|
||||||
"#<Jekyll::Collection @label=#{label} docs=#{docs}>"
|
"#<#{self.class} @label=#{label} docs=#{docs}>"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Produce a sanitized label name
|
# Produce a sanitized label name
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns the inspect string for this document.
|
# Returns the inspect string for this document.
|
||||||
def inspect
|
def inspect
|
||||||
"#<Jekyll::Document #{relative_path} collection=#{collection.label}>"
|
"#<#{self.class} #{relative_path} collection=#{collection.label}>"
|
||||||
end
|
end
|
||||||
|
|
||||||
# The string representation for this document.
|
# The string representation for this document.
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ module Jekyll
|
||||||
|
|
||||||
# Returns the shorthand String identifier of this doc.
|
# Returns the shorthand String identifier of this doc.
|
||||||
def inspect
|
def inspect
|
||||||
"<Excerpt: #{id}>"
|
"<#{self.class} id=#{id}>"
|
||||||
end
|
end
|
||||||
|
|
||||||
def output
|
def output
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class TestExcerpt < JekyllUnitTest
|
||||||
|
|
||||||
context "#inspect" do
|
context "#inspect" do
|
||||||
should "contain the excerpt id as a shorthand string identifier" 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
|
end
|
||||||
|
|
||||||
should "return a string" do
|
should "return a string" do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue