summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColby Swandale <colby@taplaboratories.com>2017-03-19 19:09:56 +1100
committerColby Swandale <colby@taplaboratories.com>2017-03-19 19:09:56 +1100
commit5cd6aef0ce64391524460a76c004e46b2abb8d13 (patch)
treea87fcf0665865a2a15b8fe469e19c872f9eac49d
parent5168d7e346a4cdb7430f2585875adfb3b6aee770 (diff)
downloadbundler-5cd6aef0ce64391524460a76c004e46b2abb8d13.tar.gz
run specs without git in the env
-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