diff options
author | chrismo <chrismo@clabs.org> | 2016-06-12 00:24:06 -0500 |
---|---|---|
committer | chrismo <chrismo@clabs.org> | 2016-07-08 19:35:57 -0500 |
commit | b57b1df28b68a3b3de0246714ceffb2cc8b33a91 (patch) | |
tree | f876db5c3c2b82d908f4b66d41897ccefe0a6ffb | |
parent | 196594bb6992e01ee4654b970f486a37bf0e78fa (diff) | |
download | bundler-b57b1df28b68a3b3de0246714ceffb2cc8b33a91.tar.gz |
Starter update_specs
-rw-r--r-- | lib/bundler/cli/update.rb | 2 | ||||
-rw-r--r-- | spec/commands/update_spec.rb | 48 |
2 files changed, 49 insertions, 1 deletions
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index bef62f3b78..080d198f14 100644 --- a/lib/bundler/cli/update.rb +++ b/lib/bundler/cli/update.rb @@ -3,7 +3,7 @@ module Bundler class CLI::Update attr_reader :options, :gems def initialize(options, gems) - @options = options + @options = options.tap {|o|p o} @gems = gems end diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb index 31d5a21975..631eddbe2e 100644 --- a/spec/commands/update_spec.rb +++ b/spec/commands/update_spec.rb @@ -425,3 +425,51 @@ describe "bundle update --ruby" do end end end + +describe "bundle update conservative" do + context "patch preferred" do + it "single gem without dependencies" do + build_repo4 do + build_gem "foo", %w(1.0.0 1.0.1 1.1.0 2.0.0) + end + + install_gemfile <<-G + source "file://#{gem_repo4}" + gem 'foo', '1.0.0' + G + + gemfile <<-G + source "file://#{gem_repo4}" + gem 'foo' + G + + # bundle "update --patch_preferred" # preferred is a bit lengthy + # bundle "update --patch" + require_relative '../../lib/bundler/cli' + require_relative '../../lib/bundler/cli/update' + #Bundler::CLI::Update.new({patch: true}, []) + # Bundler.with_clean_env do + # ENV['BUNDLE_GEMFILE'] = bundled_app.to_s + # Bundler::CLI::Update.new({}, []) + # end + bundle 'update' + + # switch i guess is recognized as a gem name, so no update at all occurs + should_be_installed "foo 1.0.1" + end + end + + context "minor preferred" do + + end + + context "strict" do + it "patch preferred" + + it "minor preferred" + end + + context "dry run" do + + end +end |