Sha256: 1186aa477a8bcc07bebd860ccb9b4ddf8367d5f0de0971eb452364e1c072fc2a

Contents?: true

Size: 841 Bytes

Versions: 18

Compression:

Stored size: 841 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'spec_helper'

describe GitStats::GitData::Author do
  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, short_stat: double("my_short_stat #{i}", insertions: 5, deletions: 10)) } }
  let(:other_commits) { 10.times.map { |i| double("other_commit #{i}", author: other_author) } }

  before { repo.stub(:commits => my_commits + other_commits) }

  it 'commits should give repo commits filtered to this author' do
    author.commits.should == my_commits
  end

  it 'should count lines added from short stat' do
    author.insertions.should == 50
  end

  it 'should count lines deleted from short stat' do
    author.deletions.should == 100
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
git_stats-1.0.17 spec/git_data/author_spec.rb
git_stats-1.0.16 spec/git_data/author_spec.rb
git_stats-1.0.15 spec/git_data/author_spec.rb
git_stats-1.0.14 spec/git_data/author_spec.rb
git_stats-1.0.13 spec/git_data/author_spec.rb
git_stats-1.0.12 spec/git_data/author_spec.rb
git_stats-1.0.11 spec/git_data/author_spec.rb
git_stats-1.0.10 spec/git_data/author_spec.rb
git_stats-1.0.9 spec/git_data/author_spec.rb
git_stats-1.0.8 spec/git_data/author_spec.rb
git_stats-1.0.7 spec/git_data/author_spec.rb
git_stats-1.0.6 spec/git_data/author_spec.rb
git_stats-1.0.5 spec/git_data/author_spec.rb
git_stats-1.0.4 spec/git_data/author_spec.rb
git_stats-1.0.3 spec/git_data/author_spec.rb
git_stats-1.0.2 spec/git_data/author_spec.rb
git_stats-1.0.1 spec/git_data/author_spec.rb
git_stats-1.0.0 spec/git_data/author_spec.rb