Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/uraki66/spreadsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
zdavatz committed Jul 2, 2012
2 parents c903d01 + 1134252 commit 878103e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Binary file added test/data/test_borders.xls
Binary file not shown.
31 changes: 31 additions & 0 deletions test/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,37 @@ def test_read_merged_cells
sheet[0,0] # trigger read_worksheet
assert_equal [[2, 4, 1, 1], [3, 3, 2, 3]], sheet.merged_cells
end
def test_read_borders
path = File.join @data, 'test_borders.xls'
book = Spreadsheet.open path
assert_instance_of Excel::Workbook, book
sheet = book.worksheet 0
format = sheet.row(0).format 0
assert_equal :none, format.left
assert_equal :thin, format.top
assert_equal :medium, format.right
assert_equal :thick, format.bottom
assert_equal :builtin_black, format.left_color
assert_equal :red, format.top_color
assert_equal :green, format.right_color
assert_equal :yellow, format.bottom_color
end
def test_write_borders
book = Spreadsheet::Workbook.new
path = File.join @var, 'test_write_borders.xls'
sheet1 = book.create_worksheet
(sheet1.row(0).format 0).border = :hair
(sheet1.row(0).format 0).border_color = :brown
assert_nothing_raised do
book.write path
end
book2 = Spreadsheet.open path
assert_instance_of Excel::Workbook, book2
sheet2 = book2.worksheet 0
format = sheet2.row(0).format 0
assert_equal :hair, format.left
assert_equal :brown, format.top_color
end

private

Expand Down

0 comments on commit 878103e

Please sign in to comment.