Sha256: 499c22b5ec24690bc0b0127f93891b4093b0cb1a48db89e3e4708f9b5d694053

Contents?: true

Size: 974 Bytes

Versions: 2

Compression:

Stored size: 974 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")

class Merb::BootLoader::AfterTest < Merb::BootLoader
  after Merb::BootLoader::BeforeAppRuns
  
  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::BeforeAppRuns")
    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

2 entries across 2 versions & 1 rubygems

Version Path
merb-core-0.9.2 spec/public/boot_loader/boot_loader_spec.rb
merb-core-0.9.3 spec/public/boot_loader/boot_loader_spec.rb