diff options
author | Andre Arko <andre@arko.net> | 2015-01-26 20:53:46 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-01-26 22:58:35 -0800 |
commit | 8c69501e77dbfabe5be2bd49505c40fae705de04 (patch) | |
tree | 0884622f8daef7e5fecfd8dc56971758bc5be539 | |
parent | dac605052cc408674193349471c4014d56adcbd5 (diff) | |
download | bundler-8c69501e77dbfabe5be2bd49505c40fae705de04.tar.gz |
set global config before creating gems
fixes hanging specs on 1.8.7 on Travis, I hope
-rw-r--r-- | spec/bundler/gem_helper_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 7 | ||||
-rw-r--r-- | spec/support/helpers.rb | 7 |
3 files changed, 11 insertions, 5 deletions
diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb index 47e62703b2..f94dac6a4e 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -8,7 +8,7 @@ describe Bundler::GemHelper do let(:app_gemspec_path) { app_path.join("#{app_name}.gemspec") } before(:each) do - config "gem.mit" => "false", "gem.coc" => "false", "gem.test" => "false" + global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false" bundle "gem #{app_name}" end diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index c5f9d93990..09af5b0da6 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -1,9 +1,12 @@ require "spec_helper" describe "bundle gem" do - before do - config "gem.mit" => "false", "gem.coc" => "false", "gem.test" => "false" + def reset! + super + global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false" + end + before do @git_name = `git config --global user.name`.chomp `git config --global user.name "Bundler User"` @git_email = `git config --global user.email`.chomp diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index bd28b975b0..c17a92c363 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -137,8 +137,7 @@ module Spec @out end - def config(config = nil) - path = bundled_app('.bundle/config') + def config(config = nil, path = bundled_app('.bundle/config')) return YAML.load_file(path) unless config FileUtils.mkdir_p(File.dirname(path)) File.open(path, 'w') do |f| @@ -147,6 +146,10 @@ module Spec config end + def global_config(config = nil) + config(config, home(".bundle/config")) + end + def create_file(*args) path = bundled_app(args.shift) path = args.shift if args.first.is_a?(Pathname) |