diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-22 20:13:13 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-22 20:13:13 +0200 |
| commit | 083c4c6d62011cd88966d608b0c6bb736f300a0c (patch) | |
| tree | b5ceb9b3a32c4130d84c3075966b4033bf32a118 /test/workbook/worksheet/tc_cell.rb | |
| parent | 6752225bbb8a9eec905ec02a98f1a25a309c404a (diff) | |
| download | caxlsx-083c4c6d62011cd88966d608b0c6bb736f300a0c.tar.gz caxlsx-083c4c6d62011cd88966d608b0c6bb736f300a0c.zip | |
Use Ruby 1.9 hash syntax (non-production code)
Diffstat (limited to 'test/workbook/worksheet/tc_cell.rb')
| -rw-r--r-- | test/workbook/worksheet/tc_cell.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index fef23ede..a8ab6ca1 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -6,10 +6,10 @@ class TestCell < Test::Unit::TestCase def setup p = Axlsx::Package.new p.use_shared_strings = true - @ws = p.workbook.add_worksheet :name => "hmmm" - p.workbook.styles.add_style :sz => 20 + @ws = p.workbook.add_worksheet name: "hmmm" + p.workbook.styles.add_style sz: 20 @row = @ws.add_row - @c = @row.add_cell 1, :type => :float, :style => 1, :escape_formulas => true + @c = @row.add_cell 1, type: :float, style: 1, escape_formulas: true data = (0..26).map { |index| index } @ws.add_row data @cAA = @ws["AA2"] @@ -62,7 +62,7 @@ class TestCell < Test::Unit::TestCase end def test_autowidth - style = @c.row.worksheet.workbook.styles.add_style({ :alignment => { :horizontal => :center, :vertical => :center, :wrap_text => true } }) + style = @c.row.worksheet.workbook.styles.add_style({ alignment: { horizontal: :center, vertical: :center, wrap_text: true } }) @c.style = style assert_in_delta(6.6, @c.autowidth, 0.01) @@ -539,20 +539,20 @@ 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' + @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_bolding - @c.style = @c.row.worksheet.workbook.styles.add_style :b => true + @c.style = @c.row.worksheet.workbook.styles.add_style b: true assert_equal(@c.row.worksheet.workbook.styles.fonts.first.sz * 1.5, @c.send(:font_size)) end def test_font_size_with_custom_sz - @c.style = @c.row.worksheet.workbook.styles.add_style :sz => 52 + @c.style = @c.row.worksheet.workbook.styles.add_style sz: 52 sz = @c.send(:font_size) assert_equal(52, sz) |
