Sha256: 8873f0ec2ae19cfc75377e50a4a628f07e91a0fb0ec1709331311e8541262ac7
Contents?: true
Size: 1.7 KB
Versions: 3
Compression:
Stored size: 1.7 KB
Contents
require 'spec/spec_helper' describe Rails::Plugin::Loader do attr_reader :loader, :plugin, :directory before do @loader = Rails::Plugin::Loader.new(OpenStruct.new({ :loaded_plugins => [] })) end describe "#register_plugin_as_loaded" do before do paths = [] stub(EngineAssets::PublicLocator).paths { paths } end context "given a plugin which is an engine and contains a 'public' directory" do before do @directory = File.join(basedir, 'spec', 'support', 'fixtures') @plugin = OpenStruct.new({ :engine? => true, :directory => directory }) end it "registers the plugin with the EngineAssets::PublicLocator" do loader.send(:register_plugin_as_loaded, plugin) EngineAssets::PublicLocator.paths.should == [ "#{directory}/public" ] end end context "given a plugin which is an engine and does NOT contain a 'public' directory" do before do @directory = basedir @plugin = OpenStruct.new({ :engine? => true, :directory => directory }) end it "does not register the plugin with the EngineAssets::PublicLocator" do loader.send(:register_plugin_as_loaded, plugin) EngineAssets::PublicLocator.paths.should == [] end end context "given a plugin which is NOT an engine" do before do @directory = File.join(basedir, 'spec', 'support', 'fixtures') @plugin = OpenStruct.new({ :engine? => false, :directory => directory }) end it "does not register the plugin with the EngineAssets::PublicLocator" do loader.send(:register_plugin_as_loaded, plugin) EngineAssets::PublicLocator.paths.should == [] end end end end
Version data entries
3 entries across 3 versions & 1 rubygems