Sha256: 04c180ce44bd19ab1d9b79405c6e62c0bf25acf3a79d2782bd7e09091d0aa1ed

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

require "spec_helper"

describe "initializing a presentation" do
  let(:presentation_dir){GitHelper.presentation_dir}

  before do
    @helper = GitHelper.new(presentation_dir)
  end

  context ".presentation file" do
    it "should be written to root directory" do
      @helper.initialise_presentation do
        File.exists?(".presentation").should be_true
      end
    end

    it "should have a slides node" do
      @helper.initialise_presentation do |commits, yaml|
        yaml["slides"].should_not be_nil
      end
    end

    it "should contain a line for each commit to the repository" do
      @helper.initialise_presentation do |commits, yaml|
        yaml["slides"].length.should eql commits.length
      end
    end

    it "first line should contain the first commit number" do
      @helper.initialise_presentation({:delay => true}) do |commits, yaml|
        yaml["slides"][0]["slide"]["commit"].should eql commits.first.id
      end
    end

    it "second line should contain the second commit number" do
      @helper.initialise_presentation({:delay => true}) do |commits, yaml|
        yaml["slides"][1]["slide"]["commit"].should eql commits[1].id
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
git_presenter-0.4.0 spec/integration/initialize_presentation_spec.rb
git_presenter-0.3.0 spec/integration/initialize_presentation_spec.rb