Sha256: 8d5f64bac07efd9c809206cbd1e45865c56117a5de4f0dc5e134c0fb88ae3db1

Contents?: true

Size: 823 Bytes

Versions: 24

Compression:

Stored size: 823 Bytes

Contents

RSpec.describe RuboCop::Cop::RSpec::MultipleDescribes do
  subject(:cop) { described_class.new }

  it 'finds multiple top level describes with class and method' do
    expect_offense(<<-RUBY)
      describe MyClass, '.do_something' do; end
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use multiple top level describes - try to nest them.
      describe MyClass, '.do_something_else' do; end
    RUBY
  end

  it 'finds multiple top level describes only with class' do
    expect_offense(<<-RUBY)
      describe MyClass do; end
      ^^^^^^^^^^^^^^^^ Do not use multiple top level describes - try to nest them.
      describe MyOtherClass do; end
    RUBY
  end

  it 'skips single top level describe' do
    expect_no_offenses(<<-RUBY)
      require 'spec_helper'

      describe MyClass do
      end
    RUBY
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rubocop-rspec-1.32.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.31.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.30.1 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.30.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.29.1 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.29.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.28.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.27.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.26.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.25.1 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.25.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.24.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.23.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.22.2 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.22.1 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.22.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.21.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.20.1 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.20.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb
rubocop-rspec-1.19.0 spec/rubocop/cop/rspec/multiple_describes_spec.rb