Permalink
Browse files

Output correct class name in custom inspect string

  • Loading branch information...
ashmaroli committed Jan 11, 2019
1 parent 500dd64 commit ae0a064f3fb9768660b5325e105701faef4e4a10
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/jekyll/collection.rb
  2. +1 −1 lib/jekyll/document.rb
  3. +1 −1 lib/jekyll/excerpt.rb
  4. +1 −1 test/test_excerpt.rb
@@ -153,7 +153,7 @@ def entry_filter
#
# Returns the inspect string
def inspect
"#<Jekyll::Collection @label=#{label} docs=#{docs}>"
"#<#{self.class} @label=#{label} docs=#{docs}>"
end

# Produce a sanitized label name
@@ -295,7 +295,7 @@ def to_liquid
#
# 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.
@@ -77,7 +77,7 @@ def to_liquid

# Returns the shorthand String identifier of this doc.
def inspect
"<Excerpt: #{id}>"
"<#{self.class} id=#{id}>"
end

def output
@@ -69,7 +69,7 @@ def do_render(document)

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

0 comments on commit ae0a064

Please sign in to comment.