summaryrefslogtreecommitdiff
path: root/spec/bundler/runtime/requiring_spec.rb
blob: 1f32269622c271969a0cb71055b503aa0bc356b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

RSpec.describe "Requiring bundler" do
  it "takes care of requiring rubygems when entrypoint is bundler/setup" do
    sys_exec("#{Gem.ruby} -I#{lib_dir} -rbundler/setup -e'puts true'", env: { "RUBYOPT" => opt_add("--disable=gems", ENV["RUBYOPT"]) })

    expect(last_command.stdboth).to eq("true")
  end

  it "takes care of requiring rubygems when requiring just bundler" do
    sys_exec("#{Gem.ruby} -I#{lib_dir} -rbundler -e'puts true'", env: { "RUBYOPT" => opt_add("--disable=gems", ENV["RUBYOPT"]) })

    expect(last_command.stdboth).to eq("true")
  end
end