aboutsummaryrefslogtreecommitdiffstats
path: root/spec/runtime
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-04-01 14:22:35 -0700
committerAndre Arko <andre@arko.net>2010-04-02 00:46:58 -0700
commit76c6bb7d627d2a954e8151a54c9c16b893b4cdb5 (patch)
tree8715f37f37aa373e92fcc91040374e9778362ee4 /spec/runtime
parent4c9a157fd36739c5f21ffeeb93068ca968f26ef0 (diff)
downloadbundler-76c6bb7d627d2a954e8151a54c9c16b893b4cdb5.tar.gz
Bundler.setup now loads .bundle/environment.rb if it is current
Diffstat (limited to 'spec/runtime')
-rw-r--r--spec/runtime/environment_rb_spec.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/runtime/environment_rb_spec.rb b/spec/runtime/environment_rb_spec.rb
index f9395f2f..8be2415d 100644
--- a/spec/runtime/environment_rb_spec.rb
+++ b/spec/runtime/environment_rb_spec.rb
@@ -135,4 +135,39 @@ describe "environment.rb file" do
end
end
+ it "get regenerated when out of date" do
+ system_gems "rack-1.0.0"
+ install_gemfile %|gem "rack"|
+ bundle :lock
+ should_be_locked
+
+ env_file <<-E
+ # Generated by Bundler 0.8
+ puts "noo"
+ E
+
+ ruby <<-R
+ require "rubygems"
+ require "bundler"
+ Bundler.setup
+ R
+ out.should_not include("noo")
+ env_file.read.should include("Generated by Bundler #{Bundler::VERSION}")
+ end
+
+ it "gets used in Bundler.setup when up to date" do
+ system_gems "rack-1.0.0"
+ install_gemfile %|gem "rack"|
+ bundle :lock
+ should_be_locked
+
+ File.open(env_file, 'a'){|f| f.puts "puts 'using environment.rb'" }
+ ruby <<-R
+ require "rubygems"
+ require "bundler"
+ Bundler.setup
+ R
+ out.should include("using environment.rb")
+ end
+
end