test/toto_test.rb in toto-0.2.0 vs test/toto_test.rb in toto-0.2.1

- old
+ new

@@ -100,9 +100,20 @@ should("have an author") { topic.author }.equals AUTHOR should("have a path") { topic.path }.equals Time.now.strftime("/%Y/%m/%d/toto-and-the-wizard-of-oz/") should("have a url") { topic.url }.equals Time.now.strftime("#{URL}/%Y/%m/%d/toto-and-the-wizard-of-oz/") end + context "with a user-defined summary" do + setup do + Toto::Article.new({ + :title => "Toto & The Wizard of Oz.", + :body => "Well,\nhello ~\n, *stranger*." + }, @config.merge(:markdown => false, :summary => {:max => 150, :delim => /~\n/})) + end + + should("split the article at the delimiter") { topic.summary }.equals "Well,\nhello" + end + context "with everything specified" do setup do Toto::Article.new({ :title => "The Wizard of Oz", :body => ("a little bit of text." * 5) + "\n" + "filler" * 10,