diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-01 11:47:23 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-01 11:47:23 -0800 |
commit | 9e76b9b401b0d9e18777e2196966ef856866f7cf (patch) | |
tree | 2c3d354fe69512325708e9a05c0fcfdb51f3516d /spec/runtime | |
parent | 9fd53751e9f22f803d76ec1066a239c89ba0bd77 (diff) | |
download | bundler-9e76b9b401b0d9e18777e2196966ef856866f7cf.tar.gz |
Fixes per code review
- validate the options in the options hash
- move the default ui option into options processing
- preserve the users options hash
Diffstat (limited to 'spec/runtime')
-rw-r--r-- | spec/runtime/inline_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 0933e447..b3e90cd4 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -111,4 +111,32 @@ describe "bundler/inline#gemfile" do expect(out).to eq("CONFIRMED!") expect(exitstatus).to be_zero if exitstatus end + + it "raises an exception if passed unknown arguments" do + script <<-RUBY, :expect_err => true + gemfile(true, arglebargle: true) do + path "#{lib_path}" + gem "two" + end + + puts "success" + RUBY + expect(err).to include "Unknown options: arglebargle" + expect(out).not_to include "success" + end + + it "does not mutate the option argument" do + script <<-RUBY + require 'bundler' + options = { ui: Bundler::UI::Shell.new } + gemfile(false, options) do + path "#{lib_path}" + gem "two" + end + puts "OKAY" if options.key?(:ui) + RUBY + + expect(out).to match("OKAY") + expect(exitstatus).to be_zero if exitstatus + end end |