forked from ruby-grape/grape-swagger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec_helper.rb
32 lines (23 loc) · 851 Bytes
/
spec_helper.rb
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
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
MODEL_PARSER = ENV.key?('MODEL_PARSER') ? ENV['MODEL_PARSER'].to_s.downcase.sub('grape-swagger-', '') : 'mock'
require 'ostruct'
require 'grape'
require 'grape-swagger'
Dir[File.join(Dir.getwd, 'spec/support/*.rb')].each { |f| require f }
require "grape-swagger/#{MODEL_PARSER}" if MODEL_PARSER != 'mock'
require File.join(Dir.getwd, "spec/support/model_parsers/#{MODEL_PARSER}_parser.rb")
require 'grape-entity'
require 'grape-swagger-entity'
Bundler.setup :default, :test
require 'rack'
require 'rack/test'
RSpec.configure do |config|
require 'rspec/expectations'
config.include RSpec::Matchers
config.mock_with :rspec
config.include Rack::Test::Methods
config.raise_errors_for_deprecations!
config.order = 'random'
config.seed = 40_834
end