Skip to content

Commit

Permalink
Add test that ensures stop iteration is raised
Browse files Browse the repository at this point in the history
  • Loading branch information
njaremko committed Jan 30, 2025
1 parent 5507d4a commit 4804aa0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/basic_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ def test_parse_csv_with_invalid_utf8
end
end

def test_enumerator_raises_stop_iteration
enum = OSV.for_each("test/test.csv")
3.times { enum.next } # Consume all records
assert_raises(StopIteration) do
enum.next
end
end

def test_parse_csv_with_invalid_utf8_file
File.write("test/invalid_utf8.csv", "id,name\n1,\xFF\xFF\n")
assert_raises(EncodingError) do
Expand Down

0 comments on commit 4804aa0

Please sign in to comment.