mirror of
https://github.com/tomgi/git_stats.git
synced 2024-11-18 01:20:42 +01:00
31 lines
702 B
Ruby
31 lines
702 B
Ruby
# -*- encoding : utf-8 -*-
|
|
require 'integration/shared'
|
|
|
|
describe GitStats::GitData::Repo do
|
|
include_context "shared"
|
|
|
|
it 'should gather all files in repo' do
|
|
repo.files.map(&:filename).should =~ %w(long_second.haml long.txt second.txt test2.rb test.rb test.txt)
|
|
end
|
|
|
|
it 'should retrieve correct file content for old file' do
|
|
repo.commits.first! { |c| c.sha == 'c87ecf9c0bbdca29d73def8ed442cebf48178d92' }.files.first! { |f| f.filename == 'test.txt' }.content.should == "bb
|
|
|
|
|
|
|
|
test
|
|
"
|
|
end
|
|
|
|
it 'should retrieve correct file content for the newest file' do
|
|
file = repo.files.first! { |f| f.filename == 'test.txt' }
|
|
file.content.should == "bb
|
|
|
|
testtest
|
|
|
|
test
|
|
"
|
|
end
|
|
|
|
|
|
end
|