Sha256: 2e143e6caf565d08ea3814b3eecbfc652c23d7d9be540bdab6fbeb3deaeb2a4c
Contents?: true
Size: 1.2 KB
Versions: 2
Compression:
Stored size: 1.2 KB
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 it 'should raise ArgumentError if valid container is given' do Hashmake::ArgSpec::CONTAINERS.each do |container| hash = { :reqd => true, :key => :stuff, :type => String, :container => container } lambda { Hashmake::ArgSpec.new hash }.should_not raise_error(ArgumentError) end end it 'should raise ArgumentError if invalid container is given' do hash = { :reqd => true, :key => :stuff, :type => String, :container => :myOwnContainer } lambda { Hashmake::ArgSpec.new hash }.should raise_error(ArgumentError) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hashmake-0.1.4 | spec/arg_spec_spec.rb |
hashmake-0.1.3 | spec/arg_spec_spec.rb |