From 9652b7ef8024c9d8ec5d00b2fca5304d533dd02c Mon Sep 17 00:00:00 2001 From: Meeka Date: Mon, 30 Dec 2013 12:23:41 -0500 Subject: [PATCH] adds to_s method testing on Excerpt --- test/test_excerpt.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_excerpt.rb b/test/test_excerpt.rb index e1558681..d93413f8 100644 --- a/test/test_excerpt.rb +++ b/test/test_excerpt.rb @@ -56,6 +56,17 @@ class TestExcerpt < Test::Unit::TestCase end end + context "#to_s" do + should "return its content if no output present" do + assert_equal @excerpt.content, @excerpt.to_s + end + + should "return its output if output present" do + @excerpt.output = "Fake Output" + assert_equal @excerpt.output, @excerpt.to_s + end + end + context "#inspect" do should "contain the excerpt id" do assert_include @excerpt.inspect, @excerpt.id