Fix spelling mistake in errors
This commit is contained in:
parent
acea5b6cf1
commit
f7118f37ad
2 changed files with 5 additions and 5 deletions
|
@ -41,7 +41,7 @@ require 'date'
|
||||||
# Holidays.between(from, to, :ca_bc, :informal)
|
# Holidays.between(from, to, :ca_bc, :informal)
|
||||||
module Holidays
|
module Holidays
|
||||||
# Exception thrown when an unknown region is requested.
|
# Exception thrown when an unknown region is requested.
|
||||||
class UnkownRegionError < ArgumentError; end
|
class UnknownRegionError < ArgumentError; end
|
||||||
|
|
||||||
VERSION = '0.9.2'
|
VERSION = '0.9.2'
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ private
|
||||||
|
|
||||||
regions.flatten!
|
regions.flatten!
|
||||||
|
|
||||||
raise UnkownRegionError unless regions.all? { |r| r == :any or @@regions.include?(r) }
|
raise UnknownRegionError unless regions.all? { |r| r == :any or @@regions.include?(r) }
|
||||||
|
|
||||||
regions
|
regions
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,15 +31,15 @@ class HolidaysTests < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_requires_valid_regions
|
def test_requires_valid_regions
|
||||||
assert_raises Holidays::UnkownRegionError do
|
assert_raises Holidays::UnknownRegionError do
|
||||||
Holidays.on(Date.civil(2008,1,1), :xx)
|
Holidays.on(Date.civil(2008,1,1), :xx)
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raises Holidays::UnkownRegionError do
|
assert_raises Holidays::UnknownRegionError do
|
||||||
Holidays.on(Date.civil(2008,1,1), [:ca,:xx])
|
Holidays.on(Date.civil(2008,1,1), [:ca,:xx])
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raises Holidays::UnkownRegionError do
|
assert_raises Holidays::UnknownRegionError do
|
||||||
Holidays.between(Date.civil(2008,1,1), Date.civil(2008,12,31), [:ca,:xx])
|
Holidays.between(Date.civil(2008,1,1), Date.civil(2008,12,31), [:ca,:xx])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue