mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Extract a common spec helper
In order to write tests for the `word_wrap` method we have, we need a spec helper that we can require. We don't need anything fancy. The doublespeak_spec_helper is doing most of what we want except for the Doublespeak require.
This commit is contained in:
parent
07fe5eb6c8
commit
878e9582e1
4 changed files with 27 additions and 43 deletions
|
@ -5,20 +5,14 @@ Tests::CurrentBundle.instance.assert_appraisal!
|
|||
#---
|
||||
|
||||
require 'rspec/core'
|
||||
require 'pry'
|
||||
require 'pry-byebug'
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
Dir[ File.join(File.expand_path('../support/acceptance/**/*.rb', __FILE__)) ].sort.each do |file|
|
||||
require file
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.order = :random
|
||||
|
||||
config.expect_with :rspec do |c|
|
||||
c.syntax = :expect
|
||||
end
|
||||
|
||||
if config.respond_to?(:infer_spec_type_from_file_location!)
|
||||
config.infer_spec_type_from_file_location!
|
||||
end
|
||||
|
@ -27,5 +21,3 @@ RSpec.configure do |config|
|
|||
|
||||
config.include AcceptanceTests::Matchers
|
||||
end
|
||||
|
||||
$VERBOSE = true
|
||||
|
|
|
@ -1,18 +1,2 @@
|
|||
require 'shoulda/matchers/doublespeak'
|
||||
|
||||
PROJECT_ROOT = File.expand_path('../..', __FILE__)
|
||||
$LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.order = :random
|
||||
|
||||
config.expect_with :rspec do |c|
|
||||
c.syntax = :expect
|
||||
end
|
||||
|
||||
if config.files_to_run.one?
|
||||
config.default_formatter = 'doc'
|
||||
end
|
||||
|
||||
config.mock_with :rspec
|
||||
end
|
||||
require 'spec_helper'
|
||||
|
|
23
spec/spec_helper.rb
Normal file
23
spec/spec_helper.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
PROJECT_ROOT = File.expand_path('../..', __FILE__)
|
||||
$LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
|
||||
|
||||
require 'pry'
|
||||
require 'pry-byebug'
|
||||
|
||||
require 'rspec'
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.order = :random
|
||||
|
||||
config.expect_with :rspec do |c|
|
||||
c.syntax = :expect
|
||||
end
|
||||
|
||||
if config.files_to_run.one?
|
||||
config.default_formatter = 'doc'
|
||||
end
|
||||
|
||||
config.mock_with :rspec
|
||||
end
|
||||
|
||||
$VERBOSE = true
|
|
@ -16,26 +16,13 @@ ENV['RAILS_ENV'] = 'test'
|
|||
require 'rspec/rails'
|
||||
require 'shoulda-matchers'
|
||||
|
||||
PROJECT_ROOT = File.expand_path('../..', __FILE__)
|
||||
$LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
|
||||
require 'spec_helper'
|
||||
|
||||
Dir[ File.join(File.expand_path('../support/unit/**/*.rb', __FILE__)) ].sort.each do |file|
|
||||
require file
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.order = :random
|
||||
|
||||
config.expect_with :rspec do |c|
|
||||
c.syntax = :expect
|
||||
end
|
||||
|
||||
if config.files_to_run.one?
|
||||
config.default_formatter = 'doc'
|
||||
end
|
||||
|
||||
config.mock_with :rspec
|
||||
|
||||
if config.respond_to?(:infer_spec_type_from_file_location!)
|
||||
config.infer_spec_type_from_file_location!
|
||||
end
|
||||
|
@ -69,5 +56,3 @@ Shoulda::Matchers.configure do |config|
|
|||
with.library :rails
|
||||
end
|
||||
end
|
||||
|
||||
$VERBOSE = true
|
||||
|
|
Loading…
Add table
Reference in a new issue