1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/spec/integration/bundler_spec.rb
Utkarsh Gupta b61aad5000 Fix bundler_spec test
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
2020-06-16 19:35:43 +05:30

30 lines
809 B
Ruby

# frozen_string_literal: true
require 'rbconfig'
RSpec.describe 'Bundler' do
let(:ruby) { RbConfig.ruby.shellescape }
let(:pry_dir) { File.expand_path(File.join(__FILE__, '../../../lib')).shellescape }
context "when Pry requires Gemfile, which doesn't specify Pry as a dependency" do
it "loads auto-completion correctly" do
code = <<-RUBY
require "bundler"
require "bundler/inline"
require "pry"
# Silence the "The Gemfile specifies no dependencies" warning
class Bundler::UI::Shell
def warn(*args, &block); end
end
gemfile(true) do
source "https://rubygems.org"
end
exit 42 if Pry.config.completer
RUBY
`#{ruby} -I#{pry_dir} -e'#{code}'`
expect($CHILD_STATUS.exitstatus).to eq(42)
end
end
end