Sha256: c4eddc9f79bb1d56dd67b693626dfd28816e72698ea88692575de20aef3ad097

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Keydown do
  before :each do
    @tmp_dir = "#{Dir.tmpdir}/keydown"
    FileUtils.rm_r @tmp_dir if File.exists?(@tmp_dir)
    FileUtils.mkdir_p @tmp_dir

    @thor = Thor.new
  end

  describe "generate command" do
    before :each do
      capture_output do
        Dir.chdir @tmp_dir do
          @thor.invoke Keydown::Tasks, ["generate", "sample"]
        end
      end
    end

    it "should generate a directory for the presentation" do
      Dir.chdir "#{@tmp_dir}" do
        File.directory?('sample').should be_true
      end
    end

    it "should generate a sample Markdown file" do
      Dir.chdir "#{@tmp_dir}/sample" do
        File.exist?("slides.md").should be_true
      end
    end

    it "should create the support directories for the presentation" do
      Dir.chdir "#{@tmp_dir}/sample" do
        File.directory?("css").should be_true
        File.directory?("images").should be_true
        File.directory?("js").should be_true
      end
    end

    it "should copy the HTML5 Rocks default CSS file" do
      File.exist?("#{@tmp_dir}/sample/css/rocks.css").should be_true
    end

    it "should copy the HTML5 Rocks default JS file" do
      File.exist?("#{@tmp_dir}/sample/js/rocks.js").should be_true
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
keydown-0.7.1 spec/tasks/generate_spec.rb