Commit 5949e302431167ecd61dec198e26f6587dbe0955
1 parent
90db28d6
Exists in
master
and in
4 other branches
Spork support added
Showing
4 changed files
with
63 additions
and
44 deletions
Show diff stats
.rspec
Gemfile
Gemfile.lock
... | ... | @@ -447,6 +447,7 @@ GEM |
447 | 447 | capybara (~> 2.0.0) |
448 | 448 | railties (>= 3) |
449 | 449 | spinach (>= 0.4) |
450 | + spork (1.0.0rc3) | |
450 | 451 | sprockets (2.2.2) |
451 | 452 | hike (~> 1.2) |
452 | 453 | multi_json (~> 1.0) |
... | ... | @@ -574,6 +575,7 @@ DEPENDENCIES |
574 | 575 | six |
575 | 576 | slim |
576 | 577 | spinach-rails (= 0.2.0) |
578 | + spork (~> 1.0rc) | |
577 | 579 | stamp |
578 | 580 | state_machine |
579 | 581 | test_after_commit | ... | ... |
spec/spec_helper.rb
1 | -require 'simplecov' unless ENV['CI'] | |
1 | +require 'rubygems' | |
2 | +require 'spork' | |
2 | 3 | |
3 | -if ENV['TRAVIS'] | |
4 | - require 'coveralls' | |
5 | - Coveralls.wear! | |
6 | -end | |
4 | +Spork.prefork do | |
5 | + require 'simplecov' unless ENV['CI'] | |
6 | + | |
7 | + if ENV['TRAVIS'] | |
8 | + require 'coveralls' | |
9 | + Coveralls.wear! | |
10 | + end | |
7 | 11 | |
8 | -# This file is copied to spec/ when you run 'rails generate rspec:install' | |
9 | -ENV["RAILS_ENV"] ||= 'test' | |
10 | -require File.expand_path("../../config/environment", __FILE__) | |
11 | -require 'rspec/rails' | |
12 | -require 'capybara/rails' | |
13 | -require 'capybara/rspec' | |
14 | -require 'webmock/rspec' | |
15 | -require 'email_spec' | |
16 | -require 'sidekiq/testing/inline' | |
17 | -require 'capybara/poltergeist' | |
18 | -Capybara.javascript_driver = :poltergeist | |
19 | -Capybara.default_wait_time = 10 | |
20 | - | |
21 | -# Requires supporting ruby files with custom matchers and macros, etc, | |
22 | -# in spec/support/ and its subdirectories. | |
23 | -Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
24 | - | |
25 | -WebMock.disable_net_connect!(allow_localhost: true) | |
26 | - | |
27 | -RSpec.configure do |config| | |
28 | - config.mock_with :rspec | |
29 | - | |
30 | - config.include LoginHelpers, type: :feature | |
31 | - config.include LoginHelpers, type: :request | |
32 | - config.include FactoryGirl::Syntax::Methods | |
33 | - config.include Devise::TestHelpers, type: :controller | |
34 | - | |
35 | - # If you're not using ActiveRecord, or you'd prefer not to run each of your | |
36 | - # examples within a transaction, remove the following line or assign false | |
37 | - # instead of true. | |
38 | - config.use_transactional_fixtures = false | |
39 | - | |
40 | - config.before do | |
41 | - # Use tmp dir for FS manipulations | |
42 | - temp_repos_path = Rails.root.join('tmp', 'test-git-base-path') | |
43 | - Gitlab.config.gitlab_shell.stub(repos_path: temp_repos_path) | |
44 | - FileUtils.rm_rf temp_repos_path | |
45 | - FileUtils.mkdir_p temp_repos_path | |
12 | + # This file is copied to spec/ when you run 'rails generate rspec:install' | |
13 | + ENV["RAILS_ENV"] ||= 'test' | |
14 | + require File.expand_path("../../config/environment", __FILE__) | |
15 | + require 'rspec/rails' | |
16 | + require 'capybara/rails' | |
17 | + require 'capybara/rspec' | |
18 | + require 'webmock/rspec' | |
19 | + require 'email_spec' | |
20 | + require 'sidekiq/testing/inline' | |
21 | + require 'capybara/poltergeist' | |
22 | + | |
23 | + # Loading more in this block will cause your tests to run faster. However, | |
24 | + | |
25 | + # if you change any configuration or code from libraries loaded here, you'll | |
26 | + # need to restart spork for it take effect. | |
27 | + Capybara.javascript_driver = :poltergeist | |
28 | + Capybara.default_wait_time = 10 | |
29 | + | |
30 | + # Requires supporting ruby files with custom matchers and macros, etc, | |
31 | + # in spec/support/ and its subdirectories. | |
32 | + Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
33 | + | |
34 | + WebMock.disable_net_connect!(allow_localhost: true) | |
35 | + | |
36 | + RSpec.configure do |config| | |
37 | + config.mock_with :rspec | |
38 | + | |
39 | + config.include LoginHelpers, type: :feature | |
40 | + config.include LoginHelpers, type: :request | |
41 | + config.include FactoryGirl::Syntax::Methods | |
42 | + config.include Devise::TestHelpers, type: :controller | |
43 | + | |
44 | + # If you're not using ActiveRecord, or you'd prefer not to run each of your | |
45 | + # examples within a transaction, remove the following line or assign false | |
46 | + # instead of true. | |
47 | + config.use_transactional_fixtures = false | |
48 | + | |
49 | + config.before do | |
50 | + # Use tmp dir for FS manipulations | |
51 | + temp_repos_path = Rails.root.join('tmp', 'test-git-base-path') | |
52 | + Gitlab.config.gitlab_shell.stub(repos_path: temp_repos_path) | |
53 | + FileUtils.rm_rf temp_repos_path | |
54 | + FileUtils.mkdir_p temp_repos_path | |
55 | + end | |
46 | 56 | end |
47 | 57 | end |
58 | + | |
59 | +Spork.each_run do | |
60 | + # This code will be run each time you run your specs. | |
61 | + | |
62 | +end | ... | ... |