diff --git a/test/spell_checking/test_method_name_check.rb b/test/spell_checking/test_method_name_check.rb index 4daaf7c..2ae5fa7 100644 --- a/test/spell_checking/test_method_name_check.rb +++ b/test/spell_checking/test_method_name_check.rb @@ -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 @@ -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 diff --git a/test/test_ractor_compatibility.rb b/test/test_ractor_compatibility.rb index 3166d0b..dfc9dc7 100644 --- a/test/test_ractor_compatibility.rb +++ b/test/test_ractor_compatibility.rb @@ -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 { @@ -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 @@ -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 @@ -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 @@ -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 { @@ -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