From 6dcc340012ed98086aa346eb3737db0804ebdefd Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 30 Sep 2012 09:07:52 +0900 Subject: Added validation spec for Range validator --- test/util/tc_validators.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/util/tc_validators.rb b/test/util/tc_validators.rb index 4de13ec3..1c3e173c 100644 --- a/test/util/tc_validators.rb +++ b/test/util/tc_validators.rb @@ -158,4 +158,11 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_split_state_type 'frozen_split' } assert_raise(ArgumentError) { Axlsx.validate_split_state_type 0 } end -end \ No newline at end of file + + def test_range_validation + # exclusive + assert_raise(ArgumentError) { Axlsx::RangeValidator.validate('foo', 1, 10, 10, false) } + # inclusive by default + assert_nothing_raised { Axlsx::RangeValidator.validate('foo', 1, 10, 10) } + end +end -- cgit v1.2.3