Skip to content

Commit 28f07a3

Browse files
committed
test against ranges created with Range.new, standardize range dates
1 parent e46ad49 commit 28f07a3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/sanitizer_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def test_strip_cdata
138138
end
139139

140140
def test_strip_passed_passed_duck_typed_range
141-
input = 2000..2005
141+
input = 2001..2005
142142
result = full_sanitize(input)
143143
acceptable_results = [
144-
"2000..2005",
144+
"2001..2005",
145145
]
146146

147147
assert_includes(acceptable_results, result)
@@ -222,6 +222,7 @@ def test_strip_links_with_unclosed_tags
222222
end
223223

224224
def test_strip_links_with_passed_duck_typed_range
225+
assert_equal "2001..2005", link_sanitize(Range.new(2001, 2005))
225226
assert_equal "2001..2005", link_sanitize(2001..2005)
226227
end
227228

@@ -310,6 +311,7 @@ def test_sanitize_form
310311
end
311312

312313
def test_sanitize_passed_duck_typed_range
314+
assert_sanitized Range.new(2001, 2005), "2001..2005"
313315
assert_sanitized 2001..2005, "2001..2005"
314316
end
315317

0 commit comments

Comments
 (0)