Commit d46e0a3b authored by Lin Jen-Shin's avatar Lin Jen-Shin

Eliminate constants warnings by:

* Replace `require` or `require_relative` with `require_dependency`
* Remove unneeded `autoload`
parent af0e6c0e
require 'gitlab/webpack/manifest'
module WebpackHelper
def webpack_bundle_tag(bundle)
javascript_include_tag(*webpack_entrypoint_paths(bundle))
......
require_relative '../../lib/gitlab'
require_dependency 'gitlab'
......@@ -26,11 +26,3 @@ if Gitlab.config.omniauth.enabled
OmniAuth.config.on_failure = ::Gitlab::Auth::GroupSaml::FailureHandler.new(OmniAuth.config.on_failure)
end
end
module OmniAuth
module Strategies
autoload :Bitbucket, Rails.root.join('lib', 'omni_auth', 'strategies', 'bitbucket')
autoload :GroupSaml, Rails.root.join('ee', 'lib', 'omni_auth', 'strategies', 'group_saml')
autoload :Jwt, Rails.root.join('lib', 'omni_auth', 'strategies', 'jwt')
end
end
......@@ -3,7 +3,7 @@ require 'jwt'
module OmniAuth
module Strategies
class JWT
class Jwt
ClaimInvalid = Class.new(StandardError)
include OmniAuth::Strategy
......@@ -56,7 +56,5 @@ module OmniAuth
fail! :claim_invalid, e
end
end
class Jwt < JWT; end
end
end
require 'json'
require_relative 'config'
require_relative 'example'
require_relative 'flaky_example'
require_relative 'flaky_examples_collection'
require_relative 'report'
require_dependency 'rspec_flaky/config'
require_dependency 'rspec_flaky/example'
require_dependency 'rspec_flaky/flaky_example'
require_dependency 'rspec_flaky/flaky_examples_collection'
require_dependency 'rspec_flaky/report'
module RspecFlaky
class Listener
......
require 'json'
require 'time'
require_relative 'config'
require_relative 'flaky_examples_collection'
require_dependency 'rspec_flaky/config'
require_dependency 'rspec_flaky/flaky_examples_collection'
module RspecFlaky
# This class is responsible for loading/saving JSON reports, and pruning
......
......@@ -5,7 +5,10 @@
# gem manually on the CI
require 'rubygems'
require_relative '../lib/rspec_flaky/report'
singleton_class.__send__(:alias_method, :require_dependency, :require)
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
require 'rspec_flaky/report'
report_file = ARGV.shift
unless report_file
......
......@@ -43,7 +43,7 @@ describe OmniAuth::Strategies::Jwt do
end
it 'raises error' do
expect { strategy.decoded }.to raise_error(OmniAuth::Strategies::JWT::ClaimInvalid)
expect { strategy.decoded }.to raise_error(OmniAuth::Strategies::Jwt::ClaimInvalid)
end
end
......@@ -61,7 +61,7 @@ describe OmniAuth::Strategies::Jwt do
end
it 'raises error' do
expect { strategy.decoded }.to raise_error(OmniAuth::Strategies::JWT::ClaimInvalid)
expect { strategy.decoded }.to raise_error(OmniAuth::Strategies::Jwt::ClaimInvalid)
end
end
......@@ -80,7 +80,7 @@ describe OmniAuth::Strategies::Jwt do
end
it 'raises error' do
expect { strategy.decoded }.to raise_error(OmniAuth::Strategies::JWT::ClaimInvalid)
expect { strategy.decoded }.to raise_error(OmniAuth::Strategies::Jwt::ClaimInvalid)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment