File: unit_spec_helper.rb

package info (click to toggle)
ruby-shoulda-matchers 7.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,652 kB
  • sloc: ruby: 34,046; sh: 280; makefile: 9
file content (46 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require_relative 'support/unit/load_environment'

require 'rspec/rails'
require 'rspec/matchers/fail_matchers'
require 'shoulda-matchers'

require 'spec_helper'

$VERBOSE = true

Dir[File.join(File.expand_path('support/unit/**/*.rb', __dir__))].sort.each do |file|
  require file
end

RSpec.configure do |config|
  config.include RSpec::Matchers::FailMatchers

  UnitTests::Configuration.configure_example_groups(config)

  config.include UnitTests::Matchers

  config.infer_spec_type_from_file_location!
  config.example_status_persistence_file_path = 'spec/examples.txt'
  config.alias_it_behaves_like_to(:it_supports, 'it supports')

  config.before(:all, type: :controller) do
    self.class.controller(ApplicationController) { }
  end

  config.before(:suite) do
    I18n.backend.send(:init_translations)
  end
end

if Rails::VERSION::STRING >= '7.2'
  Rails.application.deprecators.behavior = :stderr
else
  ActiveSupport::Deprecation.behavior = :stderr
end

Shoulda::Matchers.configure do |config|
  config.integrate do |with|
    with.test_framework :rspec
    with.library :rails
  end
end