Skip to content

Commit

Permalink
Fix integration test for Rubocop version 1.30 and above (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darhazer authored Aug 13, 2022
1 parent 5a299d2 commit f51059a
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions spec/rubocop/cop/layout/ordered_methods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,21 @@ def self.a; end
])
expect($stderr.string).to eq('')
expect(exit_status_code).to eq(::RuboCop::CLI::STATUS_OFFENSES)
expect($stdout.string).to eq(<<~OUTPUT)
== #{file.path} ==
C: 3: 3: [Correctable] Layout/OrderedMethods: Methods should be sorted in alphabetical order.
1 file inspected, 1 offense detected, 1 offense auto-correctable
OUTPUT
if RuboCop::Version::STRING >= '1.30.0'
expect($stdout.string).to eq(<<~OUTPUT)
== #{file.path} ==
C: 3: 3: [Correctable] Layout/OrderedMethods: Methods should be sorted in alphabetical order.
1 file inspected, 1 offense detected, 1 offense autocorrectable
OUTPUT
else
expect($stdout.string).to eq(<<~OUTPUT)
== #{file.path} ==
C: 3: 3: [Correctable] Layout/OrderedMethods: Methods should be sorted in alphabetical order.
1 file inspected, 1 offense detected, 1 offense auto-correctable
OUTPUT
end
end
end
end

0 comments on commit f51059a

Please sign in to comment.