diff options
Diffstat (limited to 'spec/rubocop/cop/lint/last_keyword_argument_spec.rb')
-rw-r--r-- | spec/rubocop/cop/lint/last_keyword_argument_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/rubocop/cop/lint/last_keyword_argument_spec.rb b/spec/rubocop/cop/lint/last_keyword_argument_spec.rb index b1b4c88e0f6..b0551a79c50 100644 --- a/spec/rubocop/cop/lint/last_keyword_argument_spec.rb +++ b/spec/rubocop/cop/lint/last_keyword_argument_spec.rb @@ -1,19 +1,18 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'rubocop_spec_helper' require_relative '../../../../rubocop/cop/lint/last_keyword_argument' RSpec.describe RuboCop::Cop::Lint::LastKeywordArgument do - subject(:cop) { described_class.new } - before do described_class.instance_variable_set(:@keyword_warnings, nil) + allow(Dir).to receive(:glob).and_call_original + allow(File).to receive(:read).and_call_original end context 'deprecation files does not exist' do before do - allow(Dir).to receive(:glob).and_return([]) - allow(File).to receive(:exist?).and_return(false) + allow(Dir).to receive(:glob).with(described_class::DEPRECATIONS_GLOB).and_return([]) end it 'does not register an offense' do @@ -58,7 +57,8 @@ RSpec.describe RuboCop::Cop::Lint::LastKeywordArgument do before do allow(Dir).to receive(:glob).and_return(['deprecations/service/create_spec.yml', 'deprecations/api/projects_spec.yml']) - allow(File).to receive(:read).and_return(create_spec_yaml, projects_spec_yaml) + allow(File).to receive(:read).with('deprecations/service/create_spec.yml').and_return(create_spec_yaml) + allow(File).to receive(:read).with('deprecations/api/projects_spec.yml').and_return(projects_spec_yaml) end it 'registers an offense for last keyword warning' do |