spec/lib/reveal-ck/presentation_spec.rb in reveal-ck-0.2.0 vs spec/lib/reveal-ck/presentation_spec.rb in reveal-ck-0.3.0

- old
+ new

@@ -1,12 +1,16 @@ require 'spec_helper' module RevealCK describe Presentation do + let :config do + Config.new + end + let :presentation do - presentation = Presentation.new + presentation = Presentation.new config: config presentation.add double('content', html: 'first') presentation.add double('content', html: 'second') presentation end @@ -34,11 +38,12 @@ spec_data 'presentation', 'slides.haml' end describe '.from_template' do it 'loads presentation html from a template' do - presentation = Presentation.from_template slides_haml + presentation = Presentation.from_template(file: slides_haml, + config: config) html = presentation.html expect(html).to start_with '<section>' expect(html).to include 'slides.haml' expect(html).to include '</section>' end @@ -48,29 +53,29 @@ 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 + presentation = Presentation.from_dsl file: slides_rb, config: config 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 describe '.load' do it 'can work with a .rb file' do - presentation = Presentation.load slides_rb + presentation = Presentation.load file: slides_rb, config: config html = presentation.html expect(html).to start_with '<section>' end end describe '.load' do it 'can work with a template file' do - presentation = Presentation.load slides_haml + presentation = Presentation.load file: slides_haml, config: config html = presentation.html expect(html).to start_with '<section>' end end