test/worksheet_test.rb in fast_excel-0.4.1 vs test/worksheet_test.rb in fast_excel-0.5.0
- old
+ new
@@ -94,12 +94,14 @@
end
it "should map fields correctly" do
workbook = FastExcel.open(constant_memory: true)
- ws = workbook.add_worksheet
+ ws = workbook.add_worksheet("1 should map fields correctly")
+
ws.set_right_to_left
+
assert_equal(ws[:right_to_left], 1)
ws = workbook.add_worksheet
ws.center_vertically
assert_equal(ws[:print_options_changed], 1)
@@ -115,15 +117,18 @@
assert_equal(ws[:margin_left], 1.5)
assert_equal(ws[:margin_right], 2.5)
assert_equal(ws[:margin_top], 3.5)
assert_equal(ws[:margin_bottom], 4.5)
+ assert_equal(ws[:vbreaks_count], 0)
breaks = [20, 40, 60, 20, 0]
FFI::MemoryPointer.new(:uint16, breaks.size) do |buffer|
buffer.write_array_of_uint16(breaks)
ws.set_v_pagebreaks(buffer)
end
+
+ # FastExcel.print_ffi_obj(ws)
assert_equal(ws[:vbreaks_count], 4)
end
end