summaryrefslogtreecommitdiff
path: root/spec/commands/newgem_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/commands/newgem_spec.rb')
-rw-r--r--spec/commands/newgem_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index 9f39159c55..3c9df483fa 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -169,9 +169,13 @@ RSpec.describe "bundle gem" do
context "when git is not avaiable" do
let(:gem_name) { "test_gem" }
+ # This spec cannot have `git` avaiable in the test env
before do
- allow(Bundler).to receive(:git_present?).and_return(false)
- bundle "gem #{gem_name}"
+ bundle_bin = File.expand_path("../../../exe/bundle", __FILE__)
+ load_paths = [lib, spec]
+ load_path_str = "-I#{load_paths.join(File::PATH_SEPARATOR)}"
+
+ sys_exec "PATH= #{Gem.ruby} #{load_path_str} #{bundle_bin} gem #{gem_name}"
end
it "creates the gem without the need for git" do