Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# frozen_string_literal: true

RSpec.describe RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically do
def inspected_source_filename
'spec/factories.rb'
end

it 'registers an offense for offending code' do
expect_offense(<<-RUBY)
FactoryBot.define do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# frozen_string_literal: true

RSpec.describe RuboCop::Cop::RSpec::FactoryBot::FactoryClassName do
def inspected_source_filename
'spec/factories.rb'
end

context 'when passing block' do
it 'flags passing a class' do
expect_offense(<<~RUBY)
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module SpecHelper
# We should take their advice!
config.raise_on_warning = true

config.include(ExpectOffense)
config.include(RuboCop::RSpec::ExpectOffense)

config.include_context 'with default RSpec/Language config', :config
config.include_context 'smoke test', type: :cop_spec
Expand Down
27 changes: 0 additions & 27 deletions spec/support/expect_offense.rb

This file was deleted.