Skip to content

Commit

Permalink
adds spec Kernel#open is not redefined by open-uri
Browse files Browse the repository at this point in the history
  • Loading branch information
moofkit authored and eregon committed Oct 28, 2021
1 parent 7376aa0 commit 54ef382
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/kernel/open_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ def obj.to_open; self; end
ruby_exe(code, args: "2>&1").should == "true\n"
end
end

ruby_version_is "3.0" do
it "is not redefined by open-uri" do
code = <<~RUBY
before = Kernel.instance_method(:open)
require 'open-uri'
after = Kernel.instance_method(:open)
p before == after
RUBY
ruby_exe(code, args: "2>&1").should == "true\n"
end
end
end

describe "Kernel.open" do
Expand Down

0 comments on commit 54ef382

Please sign in to comment.