Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'falcon/content'
- describe Falcon::Content do
- context "htmlify" do
- it "should process markdown" do
- Falcon::Content.htmlify("This is **clean** markup").should ==
- "<p>This is <strong>clean</strong> markup</p>"
- end
- it "should process markdown with syntax highlighting, including language ref" do
- Falcon::Content.htmlify(" :::ruby\n class Test; end").should match(/CodeRay/i)
- end
- it "should process markdown with syntax highlighting, not including language ref" do
- Falcon::Content.htmlify(" class Test; end").should match(/CodeRay/i)
- end
- end
- context "summary" do
- it "should return the full body if no delemiter is present" do
- body = "This is a long.\nlong\ntext."
- Falcon::Content.summary_of(body).should == body
- end
- it "should return the correct summary" do
- body = "This is a long.\n~\nlong\ntext."
- Falcon::Content.summary_of(body).should == "This is a long."
- end
- it "should accept a custom delimiter" do
- body = "This is a long.\n-----\nlong\ntext."
- Falcon::Content.summary_of(body, "-----\n").should == "This is a long."
- end
- end
- context "body" do
- it "should return the body without the delimiter" do
- body = "This is a long.\n~\nlong\ntext."
- Falcon::Content.body_of(body).should == "This is a long.\nlong\ntext."
- end
- it "should return the body without the delimiter for a custom delimiter" do
- body = "This is a long.\n-----\nlong\ntext."
- Falcon::Content.body_of(body, "-----\n").should == "This is a long.\nlong\ntext."
- end
- end
- end
Add Comment
Please, Sign In to add comment