diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-08-10 17:48:46 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-08-10 17:48:46 +0800 |
commit | 6234b32785061330e62c5681509cec5bd98e5302 (patch) | |
tree | 2fd3d299f52cbebf764fc742ccf342d360400d9e /spec/spec_helper.rb | |
parent | 80c22e4c09d7808d2a971c78a6232d4843c8c4f7 (diff) | |
parent | 9db46cc89a7a1f25a339e331028eb8e2cf85a541 (diff) | |
download | gitlab-ce-6234b32785061330e62c5681509cec5bd98e5302.tar.gz |
Merge remote-tracking branch 'upstream/master' into artifacts-from-ref-and-build-name
* upstream/master: (516 commits)
Rename `run` task helper method to prevent conflict with StateMachine
Add a method in Project to return a cached value of total count of projects
Add Changelog entry for Grape upgrade [ci skip]
Fix Grape tests.
Retain old behavior
Update Grape from 0.13.0 to 0.15.0.
adds second batch of tests changed to active tense
fixes part1 of files to start using active tense
Clarify the features for generating default label sets
Update tree view to sort folders with submodules
Memoize CI config node validator to prevent leaks
fix MR source project assignment
remove offending empty line
Rails prefers require_dependency so that it won't require twice:
use Unix line endings for API documentation
use long options for curl examples in API documentation (!5703)
Prefixes removed branches name with PR number when importing PR from GH
Update CHANGELOG
Remove SHA suffix for removed branches name when importing PR from GH
add linting script for documentation
...
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 70d516e05e6..97294cfc478 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,5 @@ -if ENV['SIMPLECOV'] - require 'simplecov' - SimpleCov.start :rails -end +require './spec/simplecov_env' +SimpleCovEnv.start! ENV["RAILS_ENV"] ||= 'test' @@ -44,6 +42,13 @@ RSpec.configure do |config| config.before(:suite) do TestEnv.init end + + config.around(:each, :caching) do |example| + caching_store = Rails.cache + Rails.cache = ActiveSupport::Cache::MemoryStore.new if example.metadata[:caching] + example.run + Rails.cache = caching_store + end end FactoryGirl::SyntaxRunner.class_eval do |