test/test_roo.rb in roo-2.5.1 vs test/test_roo.rb in roo-2.6.0
- old
+ new
@@ -1054,18 +1054,18 @@
end
def test_bug_to_xml_with_empty_sheets
with_each_spreadsheet(:name=>'emptysheets', :format=>[:openoffice, :excelx]) do |oo|
oo.sheets.each { |sheet|
- assert_equal nil, oo.first_row, "first_row not nil in sheet #{sheet}"
- assert_equal nil, oo.last_row, "last_row not nil in sheet #{sheet}"
- assert_equal nil, oo.first_column, "first_column not nil in sheet #{sheet}"
- assert_equal nil, oo.last_column, "last_column not nil in sheet #{sheet}"
- assert_equal nil, oo.first_row(sheet), "first_row not nil in sheet #{sheet}"
- assert_equal nil, oo.last_row(sheet), "last_row not nil in sheet #{sheet}"
- assert_equal nil, oo.first_column(sheet), "first_column not nil in sheet #{sheet}"
- assert_equal nil, oo.last_column(sheet), "last_column not nil in sheet #{sheet}"
+ assert_nil oo.first_row, "first_row not nil in sheet #{sheet}"
+ assert_nil oo.last_row, "last_row not nil in sheet #{sheet}"
+ assert_nil oo.first_column, "first_column not nil in sheet #{sheet}"
+ assert_nil oo.last_column, "last_column not nil in sheet #{sheet}"
+ assert_nil oo.first_row(sheet), "first_row not nil in sheet #{sheet}"
+ assert_nil oo.last_row(sheet), "last_row not nil in sheet #{sheet}"
+ assert_nil oo.first_column(sheet), "first_column not nil in sheet #{sheet}"
+ assert_nil oo.last_column(sheet), "last_column not nil in sheet #{sheet}"
}
oo.to_xml
end
end
@@ -2106,7 +2106,12 @@
def test_cleanup_on_error
old_temp_files = Dir.open(Dir.tmpdir).to_a
with_each_spreadsheet(:name=>'non_existent_file', :ignore_errors=>true) do |oo|; end
assert_equal Dir.open(Dir.tmpdir).to_a, old_temp_files
+ end
+
+ def test_name_with_leading_slash
+ xlsx = Roo::Excelx.new(File.join(TESTDIR,'name_with_leading_slash.xlsx'))
+ assert_equal 1, xlsx.sheets.count
end
end # class