Skip to content

Commit

Permalink
Fix message
Browse files Browse the repository at this point in the history
  • Loading branch information
jez committed Jan 2, 2024
1 parent c63e7fb commit d77ee4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class VoidCheckedTests < ::RuboCop::Cop::Base
PATTERN

MESSAGE =
"The return value in a `.void.checked(:tests)` makes test behavior " \
"diffferent from non-test behavior. Either use " \
"`.returns(T.anything).checked(:tests)` to keep checking in tests, " \
"or `.void.checked(:never)` to leave the return completely untouched."
"Returning `.void` from a sig marked `.checked(:tests)` means that the" \
"method will return a different value in non-test environments (possibly" \
"with different truthiness). Either use `.returns(T.anything).checked(:tests)`" \
"to keep checking in tests, or `.void.checked(:never)` to leave it untouched."
private_constant(:MESSAGE)

private def top_level_void(node)
Expand Down
8 changes: 4 additions & 4 deletions spec/rubocop/cop/sorbet/signatures/void_checked_tests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

RSpec.describe(RuboCop::Cop::Sorbet::VoidCheckedTests, :config) do
def message
"The return value in a `.void.checked(:tests)` makes test behavior " \
"diffferent from non-test behavior. Either use " \
"`.returns(T.anything).checked(:tests)` to keep checking in tests, " \
"or `.void.checked(:never)` to leave the return completely untouched."
"Returning `.void` from a sig marked `.checked(:tests)` means that the" \
"method will return a different value in non-test environments (possibly" \
"with different truthiness). Either use `.returns(T.anything).checked(:tests)`" \
"to keep checking in tests, or `.void.checked(:never)` to leave it untouched."
end

describe("offenses") do
Expand Down

0 comments on commit d77ee4f

Please sign in to comment.