Sha256: dd3a97e69e72d5c671c50837c945e7ba4f5db86a5d470225d08c82bd271a0af8

Contents?: true

Size: 1.24 KB

Versions: 19

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'
require 'tmpdir'
require 'rake'

module RevealCK
  module Builders
    describe CreateIndexHtml do
      it 'creates a reveal.js index.html' do
        Dir.mktmpdir do |dir|
          Dir.chdir(dir) do
            slides_html = 'slides.html'
            File.open(slides_html, 'w') do |file|
              file.puts('<section>')
              file.puts('<h1>Slides</h1>')
              file.puts('</section>')
            end

            index_html_erb =
              RevealCK.template_path('index.html',
                                     'index.html.erb')

            application = Rake::Application.new
            create_index_html =
              CreateIndexHtml.new(slides_html: slides_html,
                                  template: index_html_erb,
                                  output_dir: dir,
                                  config: Config.new,
                                  application: application)

            create_index_html.prepare
            application['create_index_html'].invoke

            expect(File.exist?('index.html')).to be true
            content = File.open('index.html', 'r').read
            expect(content).to include '<h1>Slides</h1>'
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
reveal-ck-4.0.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.9.2 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.9.1 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.9.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.8.1 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.8.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.7.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.6.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.5.1 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.5.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.4.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.3.1 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.3.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.2.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.1.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.0.1 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-3.0.0 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-0.6.2 spec/lib/reveal-ck/builders/create_index_html_spec.rb
reveal-ck-0.6.1 spec/lib/reveal-ck/builders/create_index_html_spec.rb