git_stats/spec/author_spec.rb

17 lines
560 B
Ruby
Raw Normal View History

2012-10-13 12:22:43 +02:00
require 'spec_helper'
describe GitStats::GitData::Author do
2012-10-16 20:52:22 +02:00
let(:repo) { build(:repo) }
let(:author) { build(:author, repo: repo) }
let(:other_author) { build(:author, repo: repo) }
let(:my_commits) { 10.times.map { |i| double("my_commit #{i}", :author => author) } }
let(:other_commits) { 10.times.map { |i| double("other_commit #{i}", :author => other_author) } }
2012-10-13 13:27:15 +02:00
before { repo.stub(:commits => my_commits + other_commits) }
2012-10-13 12:22:43 +02:00
it 'commits should give repo commits filtered to this author' do
author.commits.should == my_commits
end
end