Sha256: cf6bbf59712c7591ec7a0e0ef660a0fe9b7cbe2e876dca7ab8f301911ad88fb8

Contents?: true

Size: 635 Bytes

Versions: 2

Compression:

Stored size: 635 Bytes

Contents

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

describe Hashmake::ArgSpec do
  it 'should raise ArgumentError if :reqd is false and no :default value is given' do
    hash = {
      :reqd => false, :key => :some_variable, :type => String
    }
    
    lambda { Hashmake::ArgSpec.new hash }.should raise_error(ArgumentError)
  end
  
  it 'should not raise ArgumentError if :reqd is false and a :default value is given' do
    hash = {
      :reqd => false, :key => :some_variable, :type => String, :default => ""
    }
    
    lambda { Hashmake::ArgSpec.new hash }.should_not raise_error(ArgumentError)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hashmake-0.1.2 spec/arg_spec_spec.rb
hashmake-0.1.1 spec/arg_spec_spec.rb