Sha256: e074e09fe5a4429e159c476adf00a907b1089f247fdc66fce7d7777dfbeb0023
Contents?: true
Size: 1.46 KB
Versions: 1
Compression:
Stored size: 1.46 KB
Contents
# encoding: utf-8 RSpec.describe RuboCop::Cop::RSpec::ItBehavesLike, :config do subject(:cop) { described_class.new(config) } let(:cop_config) do { 'EnforcedStyle' => enforced_style } end context 'when the enforced style is `it_behaves_like`' do let(:enforced_style) { :it_behaves_like } it 'flags a violation for it_should_behave_like' do expect_offense(<<-RUBY) it_should_behave_like 'a foo' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `it_behaves_like` over `it_should_behave_like` when including examples in a nested context. RUBY end it 'does not flag a violation for it_behaves_like' do expect_no_offenses("it_behaves_like 'a foo'") end include_examples( 'autocorrect', "foo(); it_should_behave_like 'a foo'", "foo(); it_behaves_like 'a foo'" ) end context 'when the enforced style is `it_should_behave_like`' do let(:enforced_style) { :it_should_behave_like } it 'flags a violation for it_behaves_like' do expect_offense(<<-RUBY) it_behaves_like 'a foo' ^^^^^^^^^^^^^^^^^^^^^^^ Prefer `it_should_behave_like` over `it_behaves_like` when including examples in a nested context. RUBY end it 'does not flag a violation for it_behaves_like' do expect_no_offenses("it_should_behave_like 'a foo'") end include_examples( 'autocorrect', "foo(); it_behaves_like 'a foo'", "foo(); it_should_behave_like 'a foo'" ) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rubocop-rspec-1.16.0 | spec/rubocop/cop/rspec/it_behaves_like_spec.rb |