Sha256: 82eaf6c1ac5707242c833b3d82e6cb7b761905ce786581c4e5e6f5caee0f63b2

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

here = File.expand_path File.dirname(__FILE__)
require "#{here}/spec_helper"

require "deck/slide_deck"

module Deck
 describe SlideDeck do

  def doc
    @doc ||= begin
      @html = deck_widget.to_html
      noko_doc @html
    end
  end

  def deck_widget options = {}
    @deck_widget ||= SlideDeck.new options
  end

  it "renders a basic deck.js HTML page" do
    assert { doc }
    assert { @html.include? '<link href="deck.js/core/deck.core.css" rel="stylesheet" />' }
  end

  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

    deck_widget :slides => Slide.split(File.read file)
    assert { doc.css('section.slide').size == 1 }
    slide = doc.css('section.slide').first
    assert { slide["id"] == "hello" }
    assert { noko_html(slide) == "<section class=\"slide\" id=\"hello\">" +
      "<h1>hello</h1>\n" +
      "</section>"
    }
  end

 end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deckrb-0.1.1 spec/slide_deck_spec.rb