Sha256: 99b0f019766ea4da94ec0157a31413235111ed35e47552f0bc7d453edaa31d19

Contents?: true

Size: 1.13 KB

Versions: 15

Compression:

Stored size: 1.13 KB

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

include RR

describe Initializer do
  it "should have an empty configuration" do
    Initializer::configuration.should be_an_instance_of(Configuration)
  end
end

describe Initializer do
  before(:each) do
    Initializer::reset
  end

  it "run should yield the configuration object" do
    Initializer::run do |config|
      config.should be_an_instance_of(Configuration)
    end 
  end

  def make_dummy_configuration_change
    Initializer::run do |config|
      config.left = :dummy
    end
  end

  it "configuration should return the current configuration" do
    make_dummy_configuration_change
    Initializer::configuration.should be_an_instance_of(Configuration)
    Initializer::configuration.left.should == :dummy
  end
  
  it "configuration= should set a new configuration" do
    make_dummy_configuration_change
    Initializer::configuration = :dummy_config
    Initializer::configuration.should == :dummy_config
  end
  
  it "reset should clear the configuration" do
    make_dummy_configuration_change
    Initializer::reset
    Initializer::configuration.left.should {}
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
andyjeffries-rubyrep-1.2.1 spec/initializer_spec.rb
rubyrep-1.2.0 spec/initializer_spec.rb
rubyrep-1.1.2 spec/initializer_spec.rb
rubyrep-1.1.1 spec/initializer_spec.rb
rubyrep-1.1.0 spec/initializer_spec.rb
rubyrep-1.0.9 spec/initializer_spec.rb
rubyrep-1.0.8 spec/initializer_spec.rb
rubyrep-1.0.3 spec/initializer_spec.rb
rubyrep-1.0.4 spec/initializer_spec.rb
rubyrep-1.0.5 spec/initializer_spec.rb
rubyrep-1.0.6 spec/initializer_spec.rb
rubyrep-1.0.7 spec/initializer_spec.rb
rubyrep-1.0.0 spec/initializer_spec.rb
rubyrep-1.0.1 spec/initializer_spec.rb
rubyrep-1.0.2 spec/initializer_spec.rb