mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[rubygems/rubygems] Stop allowing calling #gem
on random objects
4b8570ae15
This commit is contained in:
parent
845e878f88
commit
6a5808965b
6 changed files with 1 additions and 27 deletions
|
@ -1524,22 +1524,7 @@ end
|
|||
end
|
||||
|
||||
describe "after setup" do
|
||||
it "allows calling #gem on random objects" do
|
||||
install_gemfile <<-G
|
||||
source "https://gem.repo1"
|
||||
gem "myrack"
|
||||
G
|
||||
|
||||
ruby <<-RUBY
|
||||
require "bundler/setup"
|
||||
Object.new.gem "myrack"
|
||||
puts Gem.loaded_specs["myrack"].full_name
|
||||
RUBY
|
||||
|
||||
expect(out).to eq("myrack-1.0.0")
|
||||
end
|
||||
|
||||
it "keeps Kernel#gem private", bundler: "4" do
|
||||
it "keeps Kernel#gem private" do
|
||||
install_gemfile <<-G
|
||||
source "https://gem.repo1"
|
||||
gem "myrack"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue