Sha256: 86d76165c3529e927d80becda9f124c8e8ea212a023c0598eec4d4e8011d69d1

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

describe "String!" do
  
  it 'returns a string' do
    BOX.String!('str').should.be == 'str'
  end
  
  it 'raise Demand::Failed if not a string' do
    lambda {
      BOX.String!([])
    }.should.raise(Checked::Demand::Failed)
    .message.should.match %r!Array, \[\], must be a String!
  end
  
end # === describe String!


describe "Array!" do
  
  it 'returns an array' do
    BOX.Array!([:arr]).should.be == [:arr]
  end
  
  it 'raise Demand::Failed if not an Array' do
    lambda {
      BOX.Array!(:a)
    }.should.raise(Checked::Demand::Failed)
    .message.should.match %r!Symbol, :a, is not an Array.!
  end
  
end # === describe String!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Checked-1.0.0 spec/tests/DSL.rb