git_stats/spec/factories.rb

34 lines
866 B
Ruby
Raw Normal View History

2012-10-23 20:37:42 +02:00
# -*- encoding : utf-8 -*-
2012-10-16 20:52:22 +02:00
FactoryGirl.define do
initialize_with { new(attributes) }
factory :repo, class: GitStats::GitData::Repo do
path "repo_path"
2012-10-19 18:17:36 +02:00
factory :test_repo do
path 'spec/integration/test_repo'
end
factory :test_repo_tree do
path 'spec/integration/test_repo_tree'
end
2012-10-16 20:52:22 +02:00
end
factory :author, class: GitStats::GitData::Author do
sequence(:name) { |i| "author#{i}" }
sequence(:email) { |i| "author#{i}@gmail.com" }
association :repo, strategy: :build
end
factory :commit, class: GitStats::GitData::Commit do
2012-10-20 22:38:11 +02:00
sequence(:sha) { |i| i }
2012-10-16 20:52:22 +02:00
sequence(:stamp) { |i| i }
sequence(:date) { |i| Date.new(i) }
association :repo, strategy: :build
association :author, strategy: :build
end
factory :tree, class: GitStats::GitData::Tree do
association :repo, strategy: :build
end
2012-10-23 20:37:42 +02:00
end