Guest User

Untitled

a guest
Aug 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. require 'falcon/content'
  2.  
  3. describe Falcon::Content do
  4.  
  5. context "htmlify" do
  6. it "should process markdown" do
  7. Falcon::Content.htmlify("This is **clean** markup").should ==
  8. "<p>This is <strong>clean</strong> markup</p>"
  9. end
  10.  
  11. it "should process markdown with syntax highlighting, including language ref" do
  12. Falcon::Content.htmlify(" :::ruby\n class Test; end").should match(/CodeRay/i)
  13. end
  14.  
  15. it "should process markdown with syntax highlighting, not including language ref" do
  16. Falcon::Content.htmlify(" class Test; end").should match(/CodeRay/i)
  17. end
  18. end
  19.  
  20. context "summary" do
  21. it "should return the full body if no delemiter is present" do
  22. body = "This is a long.\nlong\ntext."
  23. Falcon::Content.summary_of(body).should == body
  24. end
  25.  
  26. it "should return the correct summary" do
  27. body = "This is a long.\n~\nlong\ntext."
  28. Falcon::Content.summary_of(body).should == "This is a long."
  29. end
  30.  
  31. it "should accept a custom delimiter" do
  32. body = "This is a long.\n-----\nlong\ntext."
  33. Falcon::Content.summary_of(body, "-----\n").should == "This is a long."
  34. end
  35. end
  36.  
  37. context "body" do
  38. it "should return the body without the delimiter" do
  39. body = "This is a long.\n~\nlong\ntext."
  40. Falcon::Content.body_of(body).should == "This is a long.\nlong\ntext."
  41. end
  42.  
  43. it "should return the body without the delimiter for a custom delimiter" do
  44. body = "This is a long.\n-----\nlong\ntext."
  45. Falcon::Content.body_of(body, "-----\n").should == "This is a long.\nlong\ntext."
  46. end
  47. end
  48.  
  49. end
Add Comment
Please, Sign In to add comment