Sha256: bcd7c0e9e78fb34cdce7012da83d1d0cf73e2ba963609fa409fc893d3226af42

Contents?: true

Size: 989 Bytes

Versions: 6

Compression:

Stored size: 989 Bytes

Contents

# The before/after filters in BootLoaders are considered public API.
#
# However, Merb::BootLoader.subclasses is not considered public API and should not be used in plugins.

require File.join(File.dirname(__FILE__), "spec_helper")
startup_merb

class Merb::BootLoader::AfterTest < Merb::BootLoader
  after Merb::BootLoader::BeforeAppLoads
  
  def self.run
  end
end

class Merb::BootLoader::BeforeTest < Merb::BootLoader
  before Merb::BootLoader::Templates
  
  def self.run
  end
end

describe "The BootLoader" do
  
  it "should support adding a BootLoader after another" do
    idx = Merb::BootLoader.subclasses.index("Merb::BootLoader::BeforeAppLoads")
    Merb::BootLoader.subclasses.index("Merb::BootLoader::AfterTest").should == idx + 1
  end

  it "should support adding a BootLoader before another" do
    idx = Merb::BootLoader.subclasses.index("Merb::BootLoader::Templates")
    Merb::BootLoader.subclasses.index("Merb::BootLoader::BeforeTest").should == idx - 1
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
merb-core-1.1.3 spec10/public/boot_loader/boot_loader_spec.rb
merb-core-1.1.2 spec10/public/boot_loader/boot_loader_spec.rb
merb-core-1.1.1 spec10/public/boot_loader/boot_loader_spec.rb
merb-core-1.1.0 spec10/public/boot_loader/boot_loader_spec.rb
merb-core-1.1.0.rc1 spec10/public/boot_loader/boot_loader_spec.rb
merb-core-1.1.0.pre spec10/public/boot_loader/boot_loader_spec.rb