summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_comments.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-22 20:13:13 +0200
committerGeremia Taglialatela <[email protected]>2023-05-22 20:13:13 +0200
commit083c4c6d62011cd88966d608b0c6bb736f300a0c (patch)
treeb5ceb9b3a32c4130d84c3075966b4033bf32a118 /test/workbook/worksheet/tc_comments.rb
parent6752225bbb8a9eec905ec02a98f1a25a309c404a (diff)
downloadcaxlsx-083c4c6d62011cd88966d608b0c6bb736f300a0c.tar.gz
caxlsx-083c4c6d62011cd88966d608b0c6bb736f300a0c.zip
Use Ruby 1.9 hash syntax (non-production code)
Diffstat (limited to 'test/workbook/worksheet/tc_comments.rb')
-rw-r--r--test/workbook/worksheet/tc_comments.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/workbook/worksheet/tc_comments.rb b/test/workbook/worksheet/tc_comments.rb
index 445f2342..d9be807e 100644
--- a/test/workbook/worksheet/tc_comments.rb
+++ b/test/workbook/worksheet/tc_comments.rb
@@ -7,8 +7,8 @@ class TestComments < Test::Unit::TestCase
p = Axlsx::Package.new
wb = p.workbook
@ws = wb.add_worksheet
- @c1 = @ws.add_comment :ref => 'A1', :text => 'penut machine', :author => 'crank'
- @c2 = @ws.add_comment :ref => 'C3', :text => 'rust bucket', :author => 'PO'
+ @c1 = @ws.add_comment ref: 'A1', text: 'penut machine', author: 'crank'
+ @c2 = @ws.add_comment ref: 'C3', text: 'rust bucket', author: 'PO'
end
def test_initialize
@@ -19,19 +19,19 @@ class TestComments < Test::Unit::TestCase
def test_add_comment
assert_equal(2, @ws.comments.size)
assert_raise(ArgumentError) { @ws.comments.add_comment }
- assert_raise(ArgumentError) { @ws.comments.add_comment(:text => 'Yes We Can', :ref => 'A1') }
- assert_raise(ArgumentError) { @ws.comments.add_comment(:author => 'bob', :ref => 'A1') }
- assert_raise(ArgumentError) { @ws.comments.add_comment(:author => 'bob', :text => 'Yes We Can') }
- assert_nothing_raised { @ws.comments.add_comment(:author => 'bob', :text => 'Yes We Can', :ref => 'A1') }
+ assert_raise(ArgumentError) { @ws.comments.add_comment(text: 'Yes We Can', ref: 'A1') }
+ assert_raise(ArgumentError) { @ws.comments.add_comment(author: 'bob', ref: 'A1') }
+ assert_raise(ArgumentError) { @ws.comments.add_comment(author: 'bob', text: 'Yes We Can') }
+ assert_nothing_raised { @ws.comments.add_comment(author: 'bob', text: 'Yes We Can', ref: 'A1') }
assert_equal(3, @ws.comments.size)
end
def test_authors
assert_equal(@ws.comments.authors.size, @ws.comments.size)
- @ws.add_comment(:text => 'Yes We Can!', :author => 'bob', :ref => 'F1')
+ @ws.add_comment(text: 'Yes We Can!', author: 'bob', ref: 'F1')
assert_equal(3, @ws.comments.authors.size)
- @ws.add_comment(:text => 'Yes We Can!', :author => 'bob', :ref => 'F1')
+ @ws.add_comment(text: 'Yes We Can!', author: 'bob', ref: 'F1')
assert_equal(3, @ws.comments.authors.size, 'only unique authors are returned')
end