From 3a174bc69ac213939565da20e14eeb9e18d5413f Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Mon, 30 Sep 2013 09:53:29 +0900 Subject: add name attribute to cell to create defined names for a single cell. https://github.com/randym/axlsx/issues/241 --- test/workbook/worksheet/tc_cell.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index 208b15e0..baa7a9f1 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -50,6 +50,12 @@ class TestCell < Test::Unit::TestCase assert_equal(@cAA.r_abs,"$AA$2", "needs to accept multi-digit columns") end + def test_name + @c.name = 'foo' + assert_equal(1, @ws.workbook.defined_names.size) + assert_equal('foo', @ws.workbook.defined_names.last.name) + end + def test_style assert_raise(ArgumentError, "must reject invalid style indexes") { @c.style=@c.row.worksheet.workbook.styles.cellXfs.size } assert_nothing_raised("must allow valid style index changes") {@c.style=1} -- cgit v1.2.3