diff options
author | Hiroshi SHIBATA <[email protected]> | 2024-11-15 14:28:05 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-11-15 17:50:24 +0900 |
commit | 0afd77d76ac9eb0ad65b841dc8eb7b68d399a3cb (patch) | |
tree | 311eca9e891fc1fac0c6fe4a895d4244d1f9d071 /spec | |
parent | b4d8e90c2a9a6e6fd6d6e892a4b520a36ed131b6 (diff) |
Port test_warn_bootsnap.rb to RSpec example
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12098
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/bundled_gems_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/bundler/bundled_gems_spec.rb b/spec/bundler/bundled_gems_spec.rb index ccd2161eb2..16c67e53ad 100644 --- a/spec/bundler/bundled_gems_spec.rb +++ b/spec/bundler/bundled_gems_spec.rb @@ -153,6 +153,26 @@ RSpec.describe "bundled_gems.rb" do expect(err).to be_empty end + it "Show warning with bootsnap cases" do + script <<-RUBY + gemfile do + source "https://rubygems.org" + # gem "bootsnap", require: false + end + + # require 'bootsnap' + # Bootsnap.setup(cache_dir: 'tmp/cache') + + # bootsnap expand required feature to full path + # require 'csv' + require Gem::BUNDLED_GEMS::LIBDIR + 'ostruct' + RUBY + + expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/) + # TODO: We should assert caller location like below: + # test_warn_bootsnap.rb:14: warning: ... + end + it "Don't show warning fiddle/import when fiddle on Gemfile" do build_lib "fiddle", "1.0.0" do |s| s.write "lib/fiddle.rb", "puts 'fiddle'" |