Sha256: 9deedb4426d6afe899c9eba891ea1914522e2b1dc9336ca80de0d00d8286b70c

Contents?: true

Size: 890 Bytes

Versions: 7

Compression:

Stored size: 890 Bytes

Contents

describe Frenetic::Configurable do
  let(:test_cfg) do
    {
      url:'http://example.org'
    }
  end

  subject(:instance) { Frenetic.new( test_cfg ) }

  describe '#config' do
    subject { instance.config }

    it { should_not be_empty }
  end

  describe '#configure' do
    subject do
      cfg = nil
      instance.configure { |c| cfg = c }
      cfg
    end

    it 'should yield the configuration' do
      subject.should be_a Hash
    end
  end

  describe '.configure' do
    subject { Frenetic.configure{|c|} }

    it 'should not exist' do
      expect{ subject }.to raise_error NoMethodError
    end
  end

  describe '#initialize' do
    let(:callback) do
      Proc.new { |b| }
    end

    subject do
      Frenetic.new( &callback ).instance_variable_get( "@builder_config" )
    end

    it 'retain block arguments' do
      subject.should eq callback
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
frenetic-0.0.20.alpha.6 spec/concerns/configurable_spec.rb
frenetic-0.0.20.alpha.5 spec/concerns/configurable_spec.rb
frenetic-0.0.20.alpha.4 spec/concerns/configurable_spec.rb
frenetic-0.0.20.alpha.3 spec/concerns/configurable_spec.rb
frenetic-0.0.20.alpha.2 spec/concerns/configurable_spec.rb
frenetic-0.0.20.alpha.1 spec/concerns/configurable_spec.rb
frenetic-0.0.20.alpha.0 spec/concerns/configurable_spec.rb