spec/spec_helper.rb in omniauth-mlh-1.0.1 vs spec/spec_helper.rb in omniauth-mlh-2.0.0
- old
+ new
@@ -1,23 +1,31 @@
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
-
-require 'simplecov'
-SimpleCov.start
-
require 'bundler/setup'
-require 'rspec'
-require 'rack/test'
require 'webmock/rspec'
+require 'simplecov'
+require 'active_support'
+require 'active_support/core_ext/hash'
+
+# Configure SimpleCov before requiring our library
+SimpleCov.start do
+ add_filter '/spec/'
+ add_filter '/vendor/'
+ track_files 'lib/**/*.rb'
+ enable_coverage :branch
+end
+
require 'omniauth'
+require 'omniauth-oauth2'
require 'omniauth_mlh'
+require 'omniauth/strategies/mlh'
-Dir[File.expand_path('support/**/*', __dir__)].sort.each { |f| require f }
+Dir[File.expand_path('support/**/*.rb', __dir__)].sort.each { |f| require f }
RSpec.configure do |config|
- config.include WebMock::API
- config.include Rack::Test::Methods
- config.extend OmniAuth::Test::StrategyMacros, type: :strategy
-
- OmniAuth.config.test_mode = true
+ config.expect_with :rspec do |c|
+ c.syntax = :expect
+ end
end
+
+WebMock.disable_net_connect!(allow_localhost: true)