From 1e31f59231d7d31dc58a1e07f228897ddd4b4d7b Mon Sep 17 00:00:00 2001 From: Karol Bucek Date: Mon, 6 Jul 2020 20:09:50 +0200 Subject: [PATCH] [test] properly 'skip' test on JRuby an early return still caused ensure to execute, setting JSON constant to `nil` for later tests! --- .travis.yml | 2 -- tests/json_generator_test.rb | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2875233..78b19dd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,6 @@ rvm: matrix: allow_failures: - rvm: ruby-head - - rvm: jruby-9.1 - - rvm: jruby-9.2 - rvm: truffleruby script: "bundle exec rake" sudo: false diff --git a/tests/json_generator_test.rb b/tests/json_generator_test.rb index ee19fa5e..028f82f9 100644 --- a/tests/json_generator_test.rb +++ b/tests/json_generator_test.rb @@ -49,7 +49,6 @@ def silence end def test_remove_const_segv - return if RUBY_ENGINE == 'jruby' stress = GC.stress const = JSON::SAFE_STATE_PROTOTYPE.dup @@ -76,7 +75,7 @@ def test_remove_const_segv silence do JSON.const_set :SAFE_STATE_PROTOTYPE, const end - end if JSON.const_defined?("Ext") + end if JSON.const_defined?("Ext") && RUBY_ENGINE != 'jruby' def test_generate json = generate(@hash)