spec/slide_spec.rb in deckrb-0.3.0 vs spec/slide_spec.rb in deckrb-0.3.1

- old
+ new

@@ -178,11 +178,11 @@ def slide_from markdown_text Slide.split(markdown_text).first end - describe "sets the slide's id" do + describe "has an id" do it "based on the first header" do assert { slide_from("# foo").slide_id == "foo" } end it "lowercases and sanitizes" do @@ -190,9 +190,23 @@ end it "from a parameter if one is passed" do slide = Slide.new(:markdown_text => "# foo", :slide_id => "bar") assert { slide.slide_id == "bar" } + end + end + + describe "has a title" do + it "based on the first header" do + assert { slide_from("# Foo").title == "Foo" } + end + + it "preserves punctuation" do + assert { slide_from("# Don't tread on me!").title == "Don't tread on me!" } + end + + it "strips whitespace" do + assert { slide_from("# hi there ").title == "hi there" } end end describe "renders deck.js-compatible HTML" do it "leaves a solo H1 as an H1" do