diff --git a/CHANGELOG.md b/CHANGELOG.md index b89384e1..31d1455d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Custom Spring commands that implement `#binstub_prelude` will have that snippet of code inserted into generated binstubs just after Spring is set up. #329 - @merhard +* Change monkey-patched `Kernel.raise` from public to private (to match default Ruby behavior) #351 - @mattbrictson ## 1.1.3 diff --git a/lib/spring/application.rb b/lib/spring/application.rb index 6397d1c9..90d39dfc 100644 --- a/lib/spring/application.rb +++ b/lib/spring/application.rb @@ -270,6 +270,7 @@ def shush_backtraces end end end + private :raise end end diff --git a/test/acceptance/app_test.rb b/test/acceptance/app_test.rb index 37ad5960..90896b06 100644 --- a/test/acceptance/app_test.rb +++ b/test/acceptance/app_test.rb @@ -350,4 +350,9 @@ def binstub_prelude assert_success %(bin/rails runner 'p ENV["OMG"]'), stdout: "2" assert_success %(bin/rails runner 'p ENV.key?("FOO")'), stdout: "false" end + + test "Kernel.raise remains private" do + expr = "p Kernel.private_instance_methods.include?(:raise)" + assert_success %(bin/rails runner '#{expr}'), stdout: "true" + end end