git_stats/spec/integration/file_spec.rb
Tomasz Gieniusz 5cfd782716 refactor
2012-10-21 22:41:54 +02:00

30 lines
No EOL
593 B
Ruby

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.by_sha('c87ecf9').files.by_filename('test.txt').content.should == "bb
test
"
end
it 'should retrieve correct file content for the newest file' do
file = repo.files.by_filename('test.txt')
file.content.should == "bb
testtest
test
"
end
end