Sha256: 125be26df9f48e1747d50d67fe3b776764a0e7249f7b9c75ae5d5327707bf418
Contents?: true
Size: 800 Bytes
Versions: 16
Compression:
Stored size: 800 Bytes
Contents
RSpec.describe RuboCop::Cop::RSpec::ScatteredLet do subject(:cop) { described_class.new } it 'flags `let` after the first different node ' do expect_offense(<<-RUBY) RSpec.describe User do let(:a) { a } subject { User } let(:b) { b } ^^^^^^^^^^^^^ Group all let/let! blocks in the example group together. end RUBY end it 'doesnt flag `let!` in the middle of multiple `let`s' do expect_no_offenses(<<-RUBY) RSpec.describe User do subject { User } let(:a) { a } let!(:b) { b } let(:c) { c } end RUBY end it 'does not encounter an error when handling an empty describe' do expect { inspect_source('RSpec.describe(User) do end', 'a_spec.rb') } .not_to raise_error end end
Version data entries
16 entries across 16 versions & 1 rubygems