Skip to content
Merged
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
4 changes: 4 additions & 0 deletions test/spell_checking/test_method_name_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def nil.empty?
end

def test_does_not_append_suggestions_twice
omit "This test is not working with JRuby" if RUBY_ENGINE == "jruby"

error = assert_raise NoMethodError do
begin
@user.firstname
Expand All @@ -110,6 +112,8 @@ def test_does_not_append_suggestions_twice
end

def test_does_not_append_suggestions_three_times
omit "This test is not working with JRuby" if RUBY_ENGINE == "jruby"

error = assert_raise NoMethodError do
begin
@user.raise_no_method_error
Expand Down
24 changes: 24 additions & 0 deletions test/test_ractor_compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
class RactorCompatibilityTest < Test::Unit::TestCase
def test_class_name_suggestion_works_in_ractor
assert_ractor(<<~CODE, require_relative: "helper")
class Ractor
alias value take
end unless Ractor.method_defined? :value # compat with Ruby 3.4 and olders

class ::Book; end
include DidYouMean::TestHelper
error = Ractor.new {
Expand All @@ -22,6 +26,10 @@ class ::Book; end

def test_key_name_suggestion_works_in_ractor
assert_ractor(<<~CODE, require_relative: "helper")
class Ractor
alias value take
end unless Ractor.method_defined? :value # compat with Ruby 3.4 and olders

include DidYouMean::TestHelper
error = Ractor.new {
begin
Expand All @@ -41,6 +49,10 @@ def test_key_name_suggestion_works_in_ractor

def test_method_name_suggestion_works_in_ractor
assert_ractor(<<~CODE, require_relative: "helper")
class Ractor
alias value take
end unless Ractor.method_defined? :value # compat with Ruby 3.4 and olders

include DidYouMean::TestHelper
error = Ractor.new {
begin
Expand All @@ -59,6 +71,10 @@ def test_method_name_suggestion_works_in_ractor
if defined?(::NoMatchingPatternKeyError)
def test_pattern_key_name_suggestion_works_in_ractor
assert_ractor(<<~CODE, require_relative: "helper")
class Ractor
alias value take
end unless Ractor.method_defined? :value # compat with Ruby 3.4 and olders

include DidYouMean::TestHelper
error = Ractor.new {
begin
Expand All @@ -81,6 +97,10 @@ def test_pattern_key_name_suggestion_works_in_ractor

def test_can_raise_other_name_error_in_ractor
assert_ractor(<<~CODE, require_relative: "helper")
class Ractor
alias value take
end unless Ractor.method_defined? :value # compat with Ruby 3.4 and olders

class FirstNameError < NameError; end
include DidYouMean::TestHelper
error = Ractor.new {
Expand All @@ -98,6 +118,10 @@ class FirstNameError < NameError; end

def test_variable_name_suggestion_works_in_ractor
assert_ractor(<<~CODE, require_relative: "helper")
class Ractor
alias value take
end unless Ractor.method_defined? :value # compat with Ruby 3.4 and olders

include DidYouMean::TestHelper
error = Ractor.new {
in_ractor = in_ractor = 1
Expand Down