Skip to content

Commit 58b8cdc

Browse files
committed
rails g rspec:install
1 parent 5466810 commit 58b8cdc

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--color

spec/spec_helper.rb

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This file is copied to spec/ when you run 'rails generate rspec:install'
2+
ENV["RAILS_ENV"] ||= 'test'
3+
require File.expand_path("../../config/environment", __FILE__)
4+
require 'rspec/rails'
5+
require 'rspec/autorun'
6+
7+
# Requires supporting ruby files with custom matchers and macros, etc,
8+
# in spec/support/ and its subdirectories.
9+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
10+
11+
# Checks for pending migrations before tests are run.
12+
# If you are not using ActiveRecord, you can remove this line.
13+
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
14+
15+
RSpec.configure do |config|
16+
# ## Mock Framework
17+
#
18+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
19+
#
20+
# config.mock_with :mocha
21+
# config.mock_with :flexmock
22+
# config.mock_with :rr
23+
24+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
25+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
26+
27+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
28+
# examples within a transaction, remove the following line or assign false
29+
# instead of true.
30+
config.use_transactional_fixtures = true
31+
32+
# If true, the base class of anonymous controllers will be inferred
33+
# automatically. This will be the default behavior in future versions of
34+
# rspec-rails.
35+
config.infer_base_class_for_anonymous_controllers = false
36+
37+
# Run specs in random order to surface order dependencies. If you find an
38+
# order dependency and want to debug it, you can fix the order by providing
39+
# the seed, which is printed after each run.
40+
# --seed 1234
41+
config.order = "random"
42+
end

0 commit comments

Comments
 (0)