summaryrefslogtreecommitdiff
path: root/spec/gitlab_git_spec_helper.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-11-17 20:40:28 +0200
committerDouwe Maan <douwe@selenight.nl>2016-11-18 15:40:04 +0200
commit23c8332f133e55a8c88cc4771ad25cea17294a34 (patch)
treed4f16bd25b325ee25694d4819de815c4a529076d /spec/gitlab_git_spec_helper.rb
parentaea8baed3093c513560e9ac5ac0c5c99508d3001 (diff)
downloadgitlab-ce-absorb-gitlab-git.tar.gz
Absorb gitlab_git @ 6b077df2b68158cf8e069e3ffd6359aff038a438absorb-gitlab-git
Diffstat (limited to 'spec/gitlab_git_spec_helper.rb')
-rw-r--r--spec/gitlab_git_spec_helper.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/gitlab_git_spec_helper.rb b/spec/gitlab_git_spec_helper.rb
new file mode 100644
index 00000000000..d0b1111b3e4
--- /dev/null
+++ b/spec/gitlab_git_spec_helper.rb
@@ -0,0 +1,30 @@
+require "spec_helper"
+
+require 'simplecov'
+SimpleCov.start
+
+require 'pry'
+require 'rspec/its'
+
+RSpec::Matchers.define :be_valid_commit do
+ match do |actual|
+ actual &&
+ actual.id == SeedRepo::Commit::ID &&
+ actual.message == SeedRepo::Commit::MESSAGE &&
+ actual.author_name == SeedRepo::Commit::AUTHOR_FULL_NAME
+ end
+end
+
+GITLAB_GIT_REPOS_PATH = Rails.root.join('tmp', 'gitlab_git_tests').to_s
+TEST_REPO_PATH = File.join(GITLAB_GIT_REPOS_PATH, 'gitlab-git-test.git')
+TEST_NORMAL_REPO_PATH = File.join(GITLAB_GIT_REPOS_PATH, "not-bare-repo.git")
+TEST_MUTABLE_REPO_PATH = File.join(GITLAB_GIT_REPOS_PATH, "mutable-repo.git")
+TEST_BROKEN_REPO_PATH = File.join(GITLAB_GIT_REPOS_PATH, "broken-repo.git")
+
+RSpec.configure do |config|
+ config.run_all_when_everything_filtered = true
+ config.filter_run :focus
+ config.order = 'random'
+ config.include SeedHelper
+ config.before(:all) { ensure_seeds }
+end