From 5cd6aef0ce64391524460a76c004e46b2abb8d13 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sun, 19 Mar 2017 19:09:56 +1100 Subject: run specs without git in the env --- spec/commands/newgem_spec.rb | 8 ++++++-- 1 file 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 -- cgit v1.2.1