Skip to content

Commit

Permalink
Fix missing type sigil in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed May 31, 2022
1 parent 4cc5409 commit b9217e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def test_formatting

response = make_request("textDocument/formatting", { textDocument: { uri: "file://#{__FILE__}" } })
assert_equal(<<~FORMATTED, response[:result].first[:newText])
# typed: false
# frozen_string_literal: true
class Foo
Expand Down
10 changes: 6 additions & 4 deletions test/requests/diagnostics_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
class DiagnosticsTest < Minitest::Test
def test_diagnostics
diagnostics = [
start: { line: 3, character: 0 },
end: { line: 3, character: 0 },
start: { line: 4, character: 0 },
end: { line: 4, character: 0 },
severity: :info,
code: "Layout/IndentationWidth",
message: "Layout/IndentationWidth: Use 2 (not 0) spaces for indentation.",
]

assert_diagnostics(<<~RUBY, diagnostics)
# typed: true
# frozen_string_literal: true
def foo
Expand Down Expand Up @@ -41,14 +42,15 @@ class Foo

def test_if_inside_else_diagnostics
diagnostics = [
start: { line: 6, character: 4 },
end: { line: 6, character: 6 },
start: { line: 7, character: 4 },
end: { line: 7, character: 6 },
severity: :info,
code: "Style/IfInsideElse",
message: "Style/IfInsideElse: Convert `if` nested inside `else` to `elsif`.",
]

assert_diagnostics(<<~RUBY, diagnostics)
# typed: true
# frozen_string_literal: true
def my_method
Expand Down
1 change: 1 addition & 0 deletions test/requests/formatting_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def foo
RUBY

assert_formatted(original, <<~RUBY)
# typed: false
# frozen_string_literal: true
def foo
Expand Down

0 comments on commit b9217e2

Please sign in to comment.