Sha256: 4cd5bd23f2a2bfb43cd3ee291cfbd96dfdee960068fddf888168293eeb89054d

Contents?: true

Size: 958 Bytes

Versions: 4

Compression:

Stored size: 958 Bytes

Contents

require 'spec_helper'

describe Heirloom do

    before do
      @git_directory = Heirloom::GitDirectory.new :path => '/target/dir'
    end

    it "should read commit from the given path" do
      repo_mock = double 'repo mock'
      Repo.should_receive(:new).with('/target/dir').and_return(repo_mock)
      commits_mock = double 'commits mock'
      repo_mock.should_receive(:commits).and_return(commits_mock)
      commits_mock.should_receive(:first).and_return('git_sha')
      @git_directory.commit.should == 'git_sha'
    end

    it "should read commit from the given path" do
      repo_mock = double 'repo mock'
      Repo.should_receive(:new).with('/target/dir').and_return(repo_mock)
      commits_mock = double 'commits mock'
      repo_mock.should_receive(:commits).with('sha_i_want').
                and_return(commits_mock)
      commits_mock.should_receive(:first).and_return('git_sha')
      @git_directory.commit 'sha_i_want'
    end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
heirloom-0.3.0 spec/directory/git_directory_spec.rb
heirloom-0.3.0.rc1 spec/directory/git_directory_spec.rb
heirloom-0.2.0 spec/directory/git_directory_spec.rb
heirloom-0.1.4 spec/directory/git_directory_spec.rb