diff --git a/lib/pronto/rubocop/patch_cop.rb b/lib/pronto/rubocop/patch_cop.rb index 739b5c6..6ab984a 100644 --- a/lib/pronto/rubocop/patch_cop.rb +++ b/lib/pronto/rubocop/patch_cop.rb @@ -31,7 +31,7 @@ def processed_source end def registry - @registry ||= ::RuboCop::Cop::Registry.new(RuboCop::Cop::Cop.all) + @registry ||= ::RuboCop::Cop::Registry.new(RuboCop::Cop::Registry.all) end def rubocop_config @@ -59,7 +59,8 @@ def path def offenses team - .inspect_file(processed_source) + .investigate(processed_source) + .offenses .sort .reject(&:disabled?) end diff --git a/spec/pronto/rubocop/patch_cop_spec.rb b/spec/pronto/rubocop/patch_cop_spec.rb index 0cbf83a..fbae382 100644 --- a/spec/pronto/rubocop/patch_cop_spec.rb +++ b/spec/pronto/rubocop/patch_cop_spec.rb @@ -11,7 +11,8 @@ let(:runner) { double :runner } let(:ast) { double :ast, each_node: nil } let(:processed_source) { double :processed_source, ast: ast } - let(:team) { double :team, inspect_file: [offense] } + let(:team) { double :team, investigate: offenses } + let(:offenses) { double :offenses, offenses: [offense] } let(:offense_location) { double :location, first_line: 42, last_line: 43 } let(:offense) { double :offense, disabled?: false, location: offense_location } let(:offense_line) { double :offense_line, message: 'Err' }