Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/roo/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def each_with_pagename

def each(options = {})
return to_enum(:each, options) unless block_given?
return if last_row.nil?

if options.empty?
1.upto(last_row) do |line|
Expand Down
8 changes: 8 additions & 0 deletions test/roo/test_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ def test_bug_bbu
end
end

def test_each_on_empty_sheet
with_each_spreadsheet(name: "emptysheets", format: [:openoffice, :excelx]) do |workbook|
workbook.default_sheet = workbook.sheets.first
assert_equal [], workbook.each.to_a
assert_nil workbook.first
end
end

def test_find_by_row_huge_document
skip_long_test
options = { name: "Bibelbund", format: [:openoffice, :excelx] }
Expand Down