From edc1f5a191d7e2214bb1116f4e6cde442317f662 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 12 Aug 2012 23:07:54 +0900 Subject: specs to prove the sz bug is actually fixed. --- README.md | 4 ++++ test/workbook/worksheet/tc_cell.rb | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 8e9d9da0..5e4aea33 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,9 @@ This gem has 100% test coverage using test/unit. To execute tests for this gem, #Change log --------- +- **August.?.12**: 1.2.1 + - Add support for hyperlinks in worksheets + - Fix bug that occurs when calculating the font_size for cells that use a user specified style which does not define sz - **August.5.12**: 1.2.0 - rebuilt worksheet serialization to clean up the code base a bit. - added data labels for charts @@ -229,6 +232,7 @@ done without the help of the people below. [straydogstudio](https://github.com/straydocstudio) - For making an AWESOME axlsx templating gem for rails. +[MitchellAJ](https://github.com/MitchellAJ) - For catching a bug in font_size calculations, finding some old code in an example and above all for reporting all of that brilliantly #Copyright and License ---------- diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index b91ae3d3..9f425ec7 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -268,6 +268,22 @@ class TestCell < Test::Unit::TestCase end + def test_font_size_with_custom_style_and_no_sz + @c.style = @c.row.worksheet.workbook.styles.add_style :bg_color => 'FF00FF' + sz = @c.send(:font_size) + assert_equal(sz, @c.row.worksheet.workbook.styles.fonts.first.sz) + end + + def test_font_size_with_custom_sz + @c.style = @c.row.worksheet.workbook.styles.add_style :sz => 52 + sz = @c.send(:font_size) + assert_equal(sz, 52) + end + + def test_cell_with_sz + @c.sz = 25 + assert_equal(25, @c.send(:font_size)) + end def test_to_xml # TODO This could use some much more stringent testing related to the xml content generated! @ws.add_row [Time.now, Date.today, true, 1, 1.0, "text", "=sum(A1:A2)"] -- cgit v1.2.3