Sha256: 1c5893d543320b015b4acca0293108bedc12f8dc7145fef8e2e0d3f9ef1f0c18

Contents?: true

Size: 758 Bytes

Versions: 4

Compression:

Stored size: 758 Bytes

Contents

require 'spec_helper'

describe FluQ::DSL::Options do

  it 'should store value options' do
    subject = described_class.new { val 42 }
    subject.to_hash.should == { val: 42 }
  end

  it 'should not collide with globals' do
    subject = described_class.new { timeout 43 }
    subject.to_hash.should == { timeout: 43 }
  end

  it 'should store block options' do
    subject = described_class.new { val { 42 } }
    subject.to_hash[:val].().should == 42
  end

  it 'should store boolean options' do
    subject = described_class.new { val }
    subject.to_hash.should == { val: true }
  end

  it 'should store values with sub-options' do
    described_class.new { val(42) { sub 21 } }.to_hash.should == { val: 42, val_options: { sub: 21 } }
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fluq-0.8.1 spec/fluq/dsl/options_spec.rb
fluq-0.8.0 spec/fluq/dsl/options_spec.rb
fluq-0.7.5 spec/fluq/dsl/options_spec.rb
fluq-0.7.3 spec/fluq/dsl/options_spec.rb