From d2db7d40dd85aa8e80b6429d7fd6b8df23ecac2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 18 Jul 2018 15:06:53 +0200 Subject: Disambiguate 'File' under qa/ since we have a QA::Factory::Resource::File class as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- qa/qa/git/repository.rb | 2 +- qa/qa/page/component/dropzone.rb | 2 +- qa/qa/runtime/api/request.rb | 2 +- qa/qa/runtime/browser.rb | 4 ++-- qa/qa/runtime/key/base.rb | 4 ++-- qa/qa/runtime/release.rb | 2 +- qa/qa/scenario/test/instance.rb | 2 +- qa/spec/git/repository_spec.rb | 2 +- qa/spec/page/view_spec.rb | 4 ++-- qa/spec/scenario/test/instance_spec.rb | 2 +- qa/spec/spec_helper.rb | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) (limited to 'qa') diff --git a/qa/qa/git/repository.rb b/qa/qa/git/repository.rb index fc753554fc4..3df6db05970 100644 --- a/qa/qa/git/repository.rb +++ b/qa/qa/git/repository.rb @@ -59,7 +59,7 @@ module QA end def add_file(name, contents) - File.write(name, contents) + ::File.write(name, contents) `git add #{name}` end diff --git a/qa/qa/page/component/dropzone.rb b/qa/qa/page/component/dropzone.rb index 15bdc742fda..fd44c57123a 100644 --- a/qa/qa/page/component/dropzone.rb +++ b/qa/qa/page/component/dropzone.rb @@ -15,7 +15,7 @@ module QA # instantiated on one page because there is no distinguishing # attribute per dropzone file field. def attach_file(attachment) - filename = File.basename(attachment) + filename = ::File.basename(attachment) field_style = { visibility: 'visible', height: '', width: '' } page.attach_file(attachment, class: 'dz-hidden-input', make_visible: field_style) diff --git a/qa/qa/runtime/api/request.rb b/qa/qa/runtime/api/request.rb index c33ada0de7a..ff9f0004524 100644 --- a/qa/qa/runtime/api/request.rb +++ b/qa/qa/runtime/api/request.rb @@ -28,7 +28,7 @@ module QA # # Returns the relative path to the requested API resource def request_path(path, version: API_VERSION, **query_string) - full_path = File.join('/api', version, path) + full_path = ::File.join('/api', version, path) if query_string.any? full_path << (path.include?('?') ? '&' : '?') diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index 877864fb40c..0c8eca5229e 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -86,7 +86,7 @@ module QA end Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example| - File.join(QA::Runtime::Namespace.name, example.file_path.sub('./qa/specs/features/', '')) + ::File.join(QA::Runtime::Namespace.name, example.file_path.sub('./qa/specs/features/', '')) end Capybara.configure do |config| @@ -94,7 +94,7 @@ module QA config.javascript_driver = :chrome config.default_max_wait_time = 10 # https://github.com/mattheworiordan/capybara-screenshot/issues/164 - config.save_path = File.expand_path('../../tmp', __dir__) + config.save_path = ::File.expand_path('../../tmp', __dir__) end end diff --git a/qa/qa/runtime/key/base.rb b/qa/qa/runtime/key/base.rb index c7e5ebada7b..67a992e2115 100644 --- a/qa/qa/runtime/key/base.rb +++ b/qa/qa/runtime/key/base.rb @@ -25,8 +25,8 @@ module QA end def populate_key_data(path) - @private_key = File.binread(path) - @public_key = File.binread("#{path}.pub") + @private_key = ::File.binread(path) + @public_key = ::File.binread("#{path}.pub") @fingerprint = `ssh-keygen -l -E md5 -f #{path} | cut -d' ' -f2 | cut -d: -f2-`.chomp end diff --git a/qa/qa/runtime/release.rb b/qa/qa/runtime/release.rb index 4f83a773645..b1f7ec482c8 100644 --- a/qa/qa/runtime/release.rb +++ b/qa/qa/runtime/release.rb @@ -13,7 +13,7 @@ module QA end def version - @version ||= File.directory?("#{__dir__}/../ee") ? :EE : :CE + @version ||= ::File.directory?("#{__dir__}/../ee") ? :EE : :CE end def strategy diff --git a/qa/qa/scenario/test/instance.rb b/qa/qa/scenario/test/instance.rb index 567e5fd6cca..46eb2dabb11 100644 --- a/qa/qa/scenario/test/instance.rb +++ b/qa/qa/scenario/test/instance.rb @@ -26,7 +26,7 @@ module QA if rspec_options.any? rspec_options else - File.expand_path('../../specs/features', __dir__) + ::File.expand_path('../../specs/features', __dir__) end end end diff --git a/qa/spec/git/repository_spec.rb b/qa/spec/git/repository_spec.rb index ee1f08da238..5c65128d10c 100644 --- a/qa/spec/git/repository_spec.rb +++ b/qa/spec/git/repository_spec.rb @@ -29,7 +29,7 @@ describe QA::Git::Repository do def cd_empty_temp_directory tmp_dir = 'tmp/git-repository-spec/' - FileUtils.rm_r(tmp_dir) if File.exist?(tmp_dir) + FileUtils.rm_r(tmp_dir) if ::File.exist?(tmp_dir) FileUtils.mkdir_p tmp_dir FileUtils.cd tmp_dir end diff --git a/qa/spec/page/view_spec.rb b/qa/spec/page/view_spec.rb index aedbc3863a7..34d2ff11447 100644 --- a/qa/spec/page/view_spec.rb +++ b/qa/spec/page/view_spec.rb @@ -32,7 +32,7 @@ describe QA::Page::View do context 'when pattern is found' do before do - allow(File).to receive(:foreach) + allow(::File).to receive(:foreach) .and_yield('some element').once allow(element).to receive(:matches?) .with('some element').and_return(true) @@ -45,7 +45,7 @@ describe QA::Page::View do context 'when pattern has not been found' do before do - allow(File).to receive(:foreach) + allow(::File).to receive(:foreach) .and_yield('some element').once allow(element).to receive(:matches?) .with('some element').and_return(false) diff --git a/qa/spec/scenario/test/instance_spec.rb b/qa/spec/scenario/test/instance_spec.rb index a74a9538be8..0d0b534911f 100644 --- a/qa/spec/scenario/test/instance_spec.rb +++ b/qa/spec/scenario/test/instance_spec.rb @@ -30,7 +30,7 @@ describe QA::Scenario::Test::Instance do subject.perform("test") expect(runner).to have_received(:options=) - .with(File.expand_path('../../../qa/specs/features', __dir__)) + .with(::File.expand_path('../../../qa/specs/features', __dir__)) end end diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb index c2c6cf95406..8e6613cd688 100644 --- a/qa/spec/spec_helper.rb +++ b/qa/spec/spec_helper.rb @@ -1,6 +1,6 @@ require_relative '../qa' -Dir[File.join(__dir__, 'support', '**', '*.rb')].each { |f| require f } +Dir[::File.join(__dir__, 'support', '**', '*.rb')].each { |f| require f } RSpec.configure do |config| config.expect_with :rspec do |expectations| -- cgit v1.2.1