gitlabhq/spec/support/stubbed_repository.rb

24 lines
432 B
Ruby
Raw Normal View History

# Stubs out all Git repository access done by models so that specs can run
# against fake repositories without Grit complaining that they don't exist.
2013-01-02 23:01:08 +01:00
class Project
def satellite
FakeSatellite.new
end
class FakeSatellite
def exists?
true
end
def create
true
end
end
end
class Repository
def repo
@repo ||= Grit::Repo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq'))
end
end