diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-11-22 15:50:36 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-11-22 17:06:57 +0800 |
commit | 07d3d44775f6cc5b7a1b768cb4e5b7900d543815 (patch) | |
tree | 9b87200493dfc56a64aa6716ff4f03794b8f24c3 /spec/rubocop | |
parent | 15edf741a14a53443fb39ecb59888e75697b9c2b (diff) | |
download | gitlab-ce-07d3d44775f6cc5b7a1b768cb4e5b7900d543815.tar.gz |
Move ModuleWithInstanceVariables to Gitlab namespace
And use .rubocop.yml to exclude paths we don't care,
rather than using the cop itself to exclude.
Diffstat (limited to 'spec/rubocop')
-rw-r--r-- | spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb (renamed from spec/rubocop/cop/module_with_instance_variables_spec.rb) | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/spec/rubocop/cop/module_with_instance_variables_spec.rb b/spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb index df5e2dd2f04..1fd40653f79 100644 --- a/spec/rubocop/cop/module_with_instance_variables_spec.rb +++ b/spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' require 'rubocop' require 'rubocop/rspec/support' -require_relative '../../../rubocop/cop/module_with_instance_variables' +require_relative '../../../../rubocop/cop/gitlab/module_with_instance_variables' -describe RuboCop::Cop::ModuleWithInstanceVariables do +describe RuboCop::Cop::Gitlab::ModuleWithInstanceVariables do include CopHelper subject(:cop) { described_class.new } @@ -83,42 +83,6 @@ describe RuboCop::Cop::ModuleWithInstanceVariables do end end - context 'with regular ivar assignment' do - let(:source) do - <<~RUBY - module M - def f - @f = true - end - end - RUBY - end - - context 'when source is offending but it is a rails helper' do - before do - allow(cop).to receive(:rails_helper?).and_return(true) - end - - it_behaves_like 'not registering offense' - end - - context 'when source is offending but it is a rails mailer' do - before do - allow(cop).to receive(:rails_mailer?).and_return(true) - end - - it_behaves_like 'not registering offense' - end - - context 'when source is offending but it is a spec helper' do - before do - allow(cop).to receive(:spec_helper?).and_return(true) - end - - it_behaves_like 'not registering offense' - end - end - context 'when source is using simple or ivar assignment' do it_behaves_like 'not registering offense' do let(:source) do |