spec/slide_deck_spec.rb in deckrb-0.1.1 vs spec/slide_deck_spec.rb in deckrb-0.2.0
- old
+ new
@@ -4,10 +4,12 @@
require "deck/slide_deck"
module Deck
describe SlideDeck do
+ include Files
+
def doc
@doc ||= begin
@html = deck_widget.to_html
noko_doc @html
end
@@ -25,17 +27,14 @@
it "contains a single dummy slide" do
assert { doc.css('section.slide').size == 1 }
end
it "renders a markdown file with one slide" do
- file = nil
- dir = Files do
- file = file("hello.md", "# hello")
- end
-
+ file = file("hello.md", "# hello")
deck_widget :slides => Slide.split(File.read file)
- assert { doc.css('section.slide').size == 1 }
- slide = doc.css('section.slide').first
+ slides = doc.css('section.slide')
+ assert { slides.size == 1 }
+ slide = slides.first
assert { slide["id"] == "hello" }
assert { noko_html(slide) == "<section class=\"slide\" id=\"hello\">" +
"<h1>hello</h1>\n" +
"</section>"
}