diff options
author | Ben Sandofsky <sandofsky@gmail.com> | 2008-08-01 17:01:10 -0700 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-08-04 14:53:21 +0200 |
commit | 61842d97c5269af8a36a33115f50543a155f1608 (patch) | |
tree | 6b08b69619f1a0aa9a727a5dfaeaff1e1dead69f /railties/test | |
parent | 82343859d568799a4151facbde1f8c711ecb7a3f (diff) | |
download | rails-61842d97c5269af8a36a33115f50543a155f1608.tar.gz rails-61842d97c5269af8a36a33115f50543a155f1608.tar.bz2 rails-61842d97c5269af8a36a33115f50543a155f1608.zip |
Make requiring gems optional.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#743 state:resolved]
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/gem_dependency_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/gem_dependency_test.rb b/railties/test/gem_dependency_test.rb index b5946aa7b8..964ca50992 100644 --- a/railties/test/gem_dependency_test.rb +++ b/railties/test/gem_dependency_test.rb @@ -11,6 +11,7 @@ uses_mocha "Plugin Tests" do @gem_with_source = Rails::GemDependency.new "hpricot", :source => "http://code.whytheluckystiff.net" @gem_with_version = Rails::GemDependency.new "hpricot", :version => "= 0.6" @gem_with_lib = Rails::GemDependency.new "aws-s3", :lib => "aws/s3" + @gem_without_load = Rails::GemDependency.new "hpricot", :lib => false end def test_configuration_adds_gem_dependency @@ -62,5 +63,13 @@ uses_mocha "Plugin Tests" do @gem_with_lib.add_load_paths @gem_with_lib.load end + + def test_gem_without_lib_loading + @gem_without_load.expects(:gem).with(@gem_without_load.name) + @gem_without_load.expects(:require).with(@gem_without_load.lib).never + @gem_without_load.add_load_paths + @gem_without_load.load + end + end end |