parent
c976772b9e
commit
e8d7480a63
|
|
@ -9,6 +9,9 @@ Features
|
|||
Compatibility change:
|
||||
* Stripping leading and trailing whitespace of xlsx and csv values by default might change how your data gets parsed.
|
||||
|
||||
Bugs fixes:
|
||||
* The `range` option everywhere doesn't fail on `[]` (#107)
|
||||
|
||||
## v0.7.0 / 2015-09-11
|
||||
|
||||
Features
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ module Squib
|
|||
input = 0..(deck_size - 1) if input == :all
|
||||
input = (input.to_i)..(input.to_i) if input.respond_to? :to_i
|
||||
raise ArgumentError.new("#{input} must be Enumerable (i.e. respond_to :each).") unless input.respond_to? :each
|
||||
raise ArgumentError.new("#{input} is outside of deck range of 0..#{deck_size-1}") if input.max > (deck_size - 1)
|
||||
raise ArgumentError.new("#{input} is outside of deck range of 0..#{deck_size-1}") if (!input.max.nil?) && (input.max > (deck_size - 1))
|
||||
input
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -33,4 +33,9 @@ describe Squib::Args::CardRange do
|
|||
expect(range.to_a).to eq([0])
|
||||
end
|
||||
|
||||
it 'allows [] as an empty range' do
|
||||
range = Squib::Args::CardRange.new([], deck_size: 5)
|
||||
expect(range.to_a).to eq([])
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Reference in New Issue