0
@@ -2,60 +2,53 @@ require File.expand_path("#{File.dirname(__FILE__)}/../../../spec_helper")
0
unless Desert::VersionChecker.rails_version_is_below_1990?
0
- describe Plugin
, :shared => true do
0
it_should_behave_like "Desert::Manager fixture"
0
- @configuration = Configuration.new
0
@plugin = Rails::Plugin.new("#{RAILS_ROOT}/vendor/plugins/aa_depends_on_acts_as_spiffy")
0
@configuration = Configuration.new
0
@initializer = Rails::Initializer.new(@configuration)
0
- describe Plugin, "#require_plugin" do
0
- it_should_behave_like "Rails::Plugin"
0
- it "raises error when passed a plugin that doesn't exist" do
0
- @plugin.load(@initializer)
0
- @plugin.require_plugin "i_dont_exist"
0
- end.should raise_error(RuntimeError, "Plugin 'i_dont_exist' does not exist")
0
+ describe "#require_plugin" do
0
+ it "raises error when passed a plugin that doesn't exist" do
0
+ @plugin.load(@initializer)
0
+ @plugin.require_plugin "i_dont_exist"
0
+ end.should raise_error(RuntimeError, "Plugin 'i_dont_exist' does not exist")
0
- describe Plugin, "#load, when representing aa_depends_on_acts_as_spiffy" do
0
- it_should_behave_like "Rails::Plugin"
0
- it "evals init.rb which requires plugin dependencies and registers the plugin itself" do
0
- mock.proxy(@plugin).require_plugin('acts_as_spiffy')
0
- @plugin.load(@initializer)
0
- Desert::Manager.plugins.should == [
0
- Desert::Manager.find_plugin('the_grand_poobah'),
0
- Desert::Manager.find_plugin('acts_as_spiffy'),
0
- Desert::Manager.find_plugin('aa_depends_on_acts_as_spiffy'),
0
- it "does not load an already-loaded plugin twice" do
0
- already_loaded_plugin = Rails::Plugin.new("#{RAILS_ROOT}/vendor/plugins/acts_as_spiffy")
0
- already_loaded_plugin.load(@initializer)
0
- Desert::Manager.plugins.should == [
0
- Desert::Manager.find_plugin('the_grand_poobah'),
0
- Desert::Manager.find_plugin('acts_as_spiffy')
0
- @plugin.load(@initializer)
0
- Desert::Manager.plugins.should == [
0
- Desert::Manager.find_plugin('the_grand_poobah'),
0
- Desert::Manager.find_plugin('acts_as_spiffy'),
0
- Desert::Manager.find_plugin('aa_depends_on_acts_as_spiffy'),
0
+ describe "#load, when representing aa_depends_on_acts_as_spiffy" do
0
+ it "evals init.rb which requires plugin dependencies and registers the plugin itself" do
0
+ mock.proxy(@plugin).require_plugin('acts_as_spiffy')
0
+ @plugin.load(@initializer)
0
+ Desert::Manager.plugins.should == [
0
+ Desert::Manager.find_plugin('the_grand_poobah'),
0
+ Desert::Manager.find_plugin('acts_as_spiffy'),
0
+ Desert::Manager.find_plugin('aa_depends_on_acts_as_spiffy'),
0
+ it "does not load an already-loaded plugin twice" do
0
+ already_loaded_plugin = Rails::Plugin.new("#{RAILS_ROOT}/vendor/plugins/acts_as_spiffy")
0
+ already_loaded_plugin.load(@initializer)
0
+ Desert::Manager.plugins.should == [
0
+ Desert::Manager.find_plugin('the_grand_poobah'),
0
+ Desert::Manager.find_plugin('acts_as_spiffy')
0
+ @plugin.load(@initializer)
0
+ Desert::Manager.plugins.should == [
0
+ Desert::Manager.find_plugin('the_grand_poobah'),
0
+ Desert::Manager.find_plugin('acts_as_spiffy'),
0
+ Desert::Manager.find_plugin('aa_depends_on_acts_as_spiffy'),