File: spec_helper.rb

package info (click to toggle)
ruby-grape 1.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,156 kB
  • sloc: ruby: 25,265; makefile: 7
file content (49 lines) | stat: -rw-r--r-- 1,280 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
47
48
49
# frozen_string_literal: true

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'support'))

require 'grape'
require 'test_prof/recipes/rspec/let_it_be'

class NullAdapter
  def begin_transaction; end

  def rollback_transaction; end
end

TestProf::BeforeAll.adapter = NullAdapter.new

require 'rack/test'
require 'cookiejar'
require 'hashie'
require 'multi_xml'
require 'mime-types'

Dir["#{File.dirname(__FILE__)}/support/*.rb"].sort.each do |file|
  require file
end

eager_load!

# The default value for this setting is true in a standard Rails app,
# so it should be set to true here as well to reflect that.
I18n.enforce_available_locales = true

RSpec.configure do |config|
  config.include Rack::Test::Methods
  config.include Spec::Support::Helpers
  config.raise_errors_for_deprecations!
  config.filter_run_when_matching :focus
  config.warnings = true

  config.before(:all) { Grape::Util::InheritableSetting.reset_global! }
  config.before { Grape::Util::InheritableSetting.reset_global! }

  # Enable flags like --only-failures and --next-failure
  config.example_status_persistence_file_path = '.rspec_status'
end

require 'coveralls'
Coveralls.wear!