diff options
author | Boggs <hello@boggs.xyz> | 2016-06-29 12:29:17 +0800 |
---|---|---|
committer | Boggs <hello@boggs.xyz> | 2016-06-29 12:29:17 +0800 |
commit | ecd55e56a6a6e87e4aab49b506bf4b5edab1adaa (patch) | |
tree | 6b1261d31a5c74c2d5634c84a775a8a7b22d6f6c /spec | |
parent | ba6c83d116976e8ce27a4e9848fc392ba3979948 (diff) | |
download | bundler-ecd55e56a6a6e87e4aab49b506bf4b5edab1adaa.tar.gz |
Modify prerelease checking
Add additional specs for `--pre` flag
Diffstat (limited to 'spec')
-rw-r--r-- | spec/commands/add_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/commands/add_spec.rb b/spec/commands/add_spec.rb index 815a3a6c..d6b9b46f 100644 --- a/spec/commands/add_spec.rb +++ b/spec/commands/add_spec.rb @@ -32,15 +32,24 @@ describe "bundle add" do expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 2.3.5'") end - it "adds the gem with the last prerelease version" do + it "`--pre` flag adds the gem with the latest prerelease version" do update_repo2 do - build_gem "activesupport", "3.0.0" build_gem "activesupport", "3.0.0.beta" end bundle "add activesupport --pre" expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 3.0.0.beta'") end + + it "`--pre` flag adds the gem with the latest non-prerelease version if it is available" do + update_repo2 do + build_gem "activesupport", "3.0.0.beta" + build_gem "activesupport", "3.0.0" + end + + bundle "add activesupport --pre" + expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 3.0.0'") + end end context "when group is set" do |