diff options
Diffstat (limited to 'features/support')
| -rw-r--r-- | features/support/env.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/features/support/env.rb b/features/support/env.rb index 6f1e4df39fc..f6f88955625 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -37,6 +37,9 @@ DatabaseCleaner.strategy = :truncation Spinach.hooks.before_scenario do # Use tmp dir for FS manipulations Gitlab.config.gitlab_shell.stub(repos_path: Rails.root.join('tmp', 'test-git-base-path')) + Gitlab::Shell.any_instance.stub(:add_repository) do |path| + create_temp_repo("#{Rails.root}/tmp/test-git-base-path/#{path}.git") + end FileUtils.rm_rf Gitlab.config.gitlab_shell.repos_path FileUtils.mkdir_p Gitlab.config.gitlab_shell.repos_path DatabaseCleaner.start @@ -51,3 +54,9 @@ Spinach.hooks.before_run do include FactoryGirl::Syntax::Methods end + +def create_temp_repo(path) + FileUtils.mkdir_p path + command = "git init --quiet --bare #{path};" + system(command) +end |
