gitlabhq/spec/support/monkeypatch.rb

52 lines
615 B
Ruby
Raw Normal View History

2011-12-05 08:43:53 +01:00
# Stubbing Project <-> git host path
2011-10-08 23:36:38 +02:00
# create project using Factory only
class Project
2011-12-05 08:43:53 +01:00
def update_repository
2011-10-08 23:36:38 +02:00
true
end
2012-05-27 12:39:57 +02:00
def destroy_repository
2011-10-08 23:36:38 +02:00
true
end
def path_to_repo
2011-10-09 21:55:06 +02:00
File.join(Rails.root, "tmp", "tests", path)
2011-10-08 23:36:38 +02:00
end
2012-04-23 14:32:56 +02:00
def satellite
@satellite ||= FakeSatellite.new
end
2011-10-08 23:36:38 +02:00
end
class Key
2011-12-05 08:43:53 +01:00
def update_repository
2011-10-08 23:36:38 +02:00
true
end
2011-12-05 08:43:53 +01:00
def repository_delete_key
2011-10-08 23:36:38 +02:00
true
end
end
class UsersProject
2011-12-05 08:43:53 +01:00
def update_repository
2011-10-08 23:36:38 +02:00
true
end
end
2012-04-23 14:32:56 +02:00
class FakeSatellite
def exists?
2012-04-23 14:32:56 +02:00
true
end
def create
true
end
end
class ProtectedBranch
def update_repository
true
end
end