summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-08-12 23:07:54 +0900
committerRandy Morgan <[email protected]>2012-08-12 23:07:54 +0900
commitedc1f5a191d7e2214bb1116f4e6cde442317f662 (patch)
tree79731e9339ee5cda1e6bcb00661deff6a1eda796
parent62ff31c460b22c27213f9555065ff4ce76cc8a63 (diff)
downloadcaxlsx-edc1f5a191d7e2214bb1116f4e6cde442317f662.tar.gz
caxlsx-edc1f5a191d7e2214bb1116f4e6cde442317f662.zip
specs to prove the sz bug is actually fixed.
-rw-r--r--README.md4
-rw-r--r--test/workbook/worksheet/tc_cell.rb16
2 files changed, 20 insertions, 0 deletions
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)"]