diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-04-08 15:52:35 +1000 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-08 12:07:19 +0200 |
commit | 336cb3c0bf3d38400f6c774ca78376117b899985 (patch) | |
tree | 595dbc659f715023844f268c286777d6ec7d9c3a /railties/test | |
parent | 6891f46d10957f21f200fc4dc2b6076ff411b1da (diff) | |
download | rails-336cb3c0bf3d38400f6c774ca78376117b899985.tar.gz rails-336cb3c0bf3d38400f6c774ca78376117b899985.tar.bz2 rails-336cb3c0bf3d38400f6c774ca78376117b899985.zip |
Adding Rails.env= to railties to allow changing of rails env on the fly for rake tasks etc
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/railtie_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/test/railties/railtie_test.rb b/railties/test/railties/railtie_test.rb index 546bf5e143..2accaca855 100644 --- a/railties/test/railties/railtie_test.rb +++ b/railties/test/railties/railtie_test.rb @@ -125,5 +125,16 @@ module RailtiesTest require "#{app_path}/config/environment" assert $ran_block end + + test "we can change our environment if we want to" do + begin + original_env = Rails.env + Rails.env = 'foo' + assert_equal('foo', Rails.env) + ensure + Rails.env = original_env + assert_equal(original_env, Rails.env) + end + end end end |