diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-01-18 17:00:08 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-01-18 17:00:08 -0800 |
commit | 88741e63efa54219da9410e71d9530ad436b4097 (patch) | |
tree | 15ff5e6abd229f3fd813cc9844e5df66db65faa8 /spec/runtime/load_spec.rb | |
parent | 13f4a8827c06132ab06cffd6c7ce34b0f7beae4d (diff) | |
download | bundler-88741e63efa54219da9410e71d9530ad436b4097.tar.gz |
First pass at bbl lock
Diffstat (limited to 'spec/runtime/load_spec.rb')
-rw-r--r-- | spec/runtime/load_spec.rb | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/spec/runtime/load_spec.rb b/spec/runtime/load_spec.rb index 9b60673b..2813f1af 100644 --- a/spec/runtime/load_spec.rb +++ b/spec/runtime/load_spec.rb @@ -37,4 +37,88 @@ describe "Bubble.load" do Bubble.load("omg.rb") }.should raise_error(Bubble::GemfileNotFound, /omg\.rb/) end + + describe "when locked" do + before :each do + system_gems "rack-1.0.0", "activesupport-2.3.2", "activerecord-2.3.2", "activerecord-2.3.1" + end + + it "raises an exception if the Gemfile adds a dependency" do + gemfile <<-G + gem "rack" + G + + bbl :lock + + gemfile <<-G + gem "rack" + gem "activerecord" + G + + lambda { Bubble.load }.should raise_error(Bubble::GemfileError) + end + + it "raises an exception if the Gemfile removes a dependency" do + gemfile <<-G + gem "rack" + gem "activerecord" + G + + bbl :lock + + gemfile <<-G + gem "rack" + G + + lambda { Bubble.load }.should raise_error(Bubble::GemfileError) + end + + it "raises an exception if the Gemfile changes a dependency in an incompatible way" do + gemfile <<-G + gem "rack" + gem "activerecord" + G + + bbl :lock + + gemfile <<-G + gem "rack" + gem "activerecord", "2.3.1" + G + + lambda { Bubble.load }.should raise_error(Bubble::GemfileError) + end + + it "raises an exception if the Gemfile replaces a root with a child dep of the root" do + gemfile <<-G + gem "rack" + gem "activerecord" + G + + bbl :lock + + gemfile <<-G + gem "rack" + gem "activesupport" + G + + lambda { Bubble.load }.should raise_error(Bubble::GemfileError) + end + + it "works if the Gemfile changes in a compatible way" do + gemfile <<-G + gem "rack" + gem "activerecord", "2.3.2" + G + + bbl :lock + + gemfile <<-G + gem "rack" + gem "activerecord", ">= 2.0.0" + G + + lambda { Bubble.load }.should_not raise_error(Bubble::GemfileError) + end + end end
\ No newline at end of file |