Sha256: 7ab2324cc45bb3796fe7370dfa8dbcb9c30351cb14c9c3a036971b2f70a64f37

Contents?: true

Size: 1.26 KB

Versions: 55

Compression:

Stored size: 1.26 KB

Contents

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

describe Sprinkle::Configurable do
  module MyPrefix
    class Configurable
      include Sprinkle::Configurable
    end
  end
  
  before do
    @configurable = MyPrefix::Configurable.new
    @default = Proc.new { }
    @defaults = { :configurable => @default }
    @deployment.stub!(:defaults).and_return(@defaults)
    @deployment.stub!(:style)
  end

  it 'should be configurable via external defaults' do
    @configurable.should respond_to(:defaults)
  end

  it 'should select the defaults for the particular concrete installer class' do
    @deployment.should_receive(:defaults).and_return(@defaults)
    @defaults.should_receive(:[]).with(:configurable).and_return(@default)
  end

  it 'should configure the installer delivery mechansim' do
    @configurable.should_receive(:instance_eval)
  end

  it 'should maintain an options hash set arbitrarily via method missing' do
    @configurable.instance_eval do
      hsv 'gts'
    end
    @configurable.hsv.should == 'gts'
  end
  
  it 'should allow the delivery instance variable to be accessed' do
    @configurable.delivery = "string"
    @configurable.instance_variable_get(:@delivery).should eql("string")
  end

  after do
    @configurable.defaults(@deployment)
  end
end

Version data entries

55 entries across 55 versions & 13 rubygems

Version Path
sprinkle-0.3.2 spec/sprinkle/configurable_spec.rb
powcloud-sprinkle-0.3.4 spec/sprinkle/configurable_spec.rb
powcloud-sprinkle-0.3.0 spec/sprinkle/configurable_spec.rb
sprinkle-0.3.1 spec/sprinkle/configurable_spec.rb
sprinkle-0.3.0 spec/sprinkle/configurable_spec.rb
maxmpz-sprinkle-0.2.6.1 spec/sprinkle/configurable_spec.rb
sprinkle-0.2.6 spec/sprinkle/configurable_spec.rb
sprinkle-0.2.3 spec/sprinkle/configurable_spec.rb
sprinkle-0.2.4 spec/sprinkle/configurable_spec.rb
sprinkle-0.2.5 spec/sprinkle/configurable_spec.rb
sprinkle-0.1.8 spec/sprinkle/configurable_spec.rb
sprinkle-0.1.7 spec/sprinkle/configurable_spec.rb
sprinkle-0.1.9 spec/sprinkle/configurable_spec.rb
sprinkle-0.2.2 spec/sprinkle/configurable_spec.rb
sprinkle-0.2.1 spec/sprinkle/configurable_spec.rb