Sha256: 1272548edc854e59e01cba17d6c307388def53a8f8e9fae563af47e9078dc54f

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

require 'spec_helper'

describe Gitmine do
  let(:gitmine) { Gitmine.new }

  let(:commit_1) do
    mock(
      :message => "Commit 1 #1234",
      :committer => "Sam",
      :committed_date => Time.now
    )
  end

  before do
    Grit::Repo.stub!(:new) { 
      mock(Grit::Repo, :commits => [commit_1])
    }
  end
     
  describe "#commits" do
    it "should return the last 10 commit messages" do
      gitmine.commits.should == [commit_1]
    end
  end

  describe "#initialize" do
    context "when not a git repo" do
      it "should raise an exception"
    end

    context "when git repo" do
      it "should not raise any exception"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gitmine-0.1.1 spec/gitmine_spec.rb
gitmine-0.1.0 spec/gitmine_spec.rb