Sha256: c3d27f052cd630b634d3b782ea7a38a7c0e8d92fe2691b75461058f7b53674f5

Contents?: true

Size: 1.62 KB

Versions: 1

Compression:

Stored size: 1.62 KB

Contents

require 'spec_helper'

module RevealCK
  describe Presentation do

    let :presentation do
      presentation = Presentation.new
      presentation.add double('content', html: 'first')
      presentation.add double('content', html: 'second')
      presentation
    end

    let :html do
      presentation.html
    end

    describe '#add' do
      it 'adds to a growing list of html' do
        expect(html).to include 'first'
        expect(html).to include 'second'
        expect(html.strip).to start_with 'first'
        expect(html.strip).to end_with 'second'
      end
    end

    describe '#html' do
      it 'returns the html, in order, added so far' do
        expect(html).to start_with 'first'
        expect(html).to end_with 'second'
      end
    end

    let :slides_haml do
      spec_data 'presentation', 'slides.haml'
    end

    describe '.from_template' do
      it 'loads presentation html from a template' do
        presentation = Presentation.from_template slides_haml
        html = presentation.html
        expect(html).to start_with '<section>'
        expect(html).to include 'slides.haml'
        expect(html).to include '</section>'
      end
    end

    let :slides_rb do
      spec_data 'presentation', 'slides.rb'
    end

    describe '.from_dsl' do
      it 'loads presentation html and metadata from a dsl' do
        presentation = Presentation.from_dsl slides_rb
        html = presentation.html
        expect(html).to start_with '<section>'
        expect(html).to include 'slides.rb'
        expect(html).to include '</section>'
        expect(presentation.theme).to eq 'night'
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reveal-ck-0.1.7 spec/lib/reveal-ck/presentation_spec.rb