diff options
Diffstat (limited to 'spec/gitlab_git_spec_helper.rb')
-rw-r--r-- | spec/gitlab_git_spec_helper.rb | 30 |
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 |