spec/esv_spec.rb in excel-esv-1.0.0 vs spec/esv_spec.rb in excel-esv-2.0.0

- old
+ new

@@ -21,15 +21,36 @@ expect { ESV.parse(excel_file_with_two_worksheets) }.to raise_error(/Expected 1 worksheet, found 2/) end + it "ignores formatting" do + output = ESV.parse(excel_file_with_formatting([1, 2])) + expect(output).to eq [ + [ 1, 2 ], + ] + + expect(output[0].class).to eq Array + end + private def excel_file_with_two_worksheets book = Spreadsheet::Workbook.new book.create_worksheet book.create_worksheet + + data = "" + fake_file = StringIO.new(data) + book.write(fake_file) + data + end + + def excel_file_with_formatting(data) + book = Spreadsheet::Workbook.new + sheet = book.create_worksheet + sheet.row(0).replace(data) + sheet.row(0).default_format = Spreadsheet::Format.new(color: :blue) data = "" fake_file = StringIO.new(data) book.write(fake_file) data