Skip to content

Commit

Permalink
Merge pull request #351 from mattbrictson/define-raise-as-private
Browse files Browse the repository at this point in the history
Ensure Kernel.raise remains private after patch
  • Loading branch information
rafaelfranca committed Sep 10, 2014
2 parents 86f8428 + 4bcf933 commit c579428
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions lib/spring/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def shush_backtraces
end
end
end
private :raise
end
end

Expand Down
5 changes: 5 additions & 0 deletions test/acceptance/app_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c579428

Please sign in to comment.