summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorjohnnyshields <[email protected]>2023-04-01 17:06:08 +0900
committerjohnnyshields <[email protected]>2023-04-01 17:06:08 +0900
commit377ad94928c3f76e36d0c2aef05fca5dd13e1aae (patch)
tree877bcd843186fd1a245b902399390f5486a436f9 /test
parentc7c30f2fe05b6557454bc7e866f5091b24d8a975 (diff)
downloadcaxlsx-377ad94928c3f76e36d0c2aef05fca5dd13e1aae.tar.gz
caxlsx-377ad94928c3f76e36d0c2aef05fca5dd13e1aae.zip
Additional tests + CHANGELOG
Diffstat (limited to 'test')
-rw-r--r--test/tc_axlsx.rb13
-rw-r--r--test/workbook/tc_workbook.rb4
2 files changed, 13 insertions, 4 deletions
diff --git a/test/tc_axlsx.rb b/test/tc_axlsx.rb
index 3903fc42..a4069cfe 100644
--- a/test/tc_axlsx.rb
+++ b/test/tc_axlsx.rb
@@ -22,7 +22,6 @@ class TestAxlsx < Test::Unit::TestCase
assert_equal false, Axlsx.trust_input
end
-
def test_trust_input_can_be_set_to_true
# Class variables like this are not reset between test runs, so we have
# to save and restore the original value manually.
@@ -140,4 +139,16 @@ class TestAxlsx < Test::Unit::TestCase
assert_equal({foo: {bar: true, baz: true}}, Axlsx.hash_deep_merge(h1, h2))
end
+ def test_escape_formulas
+ Axlsx.instance_variable_set(:@escape_formulas, nil)
+ assert_equal false, Axlsx::escape_formulas
+
+ Axlsx::escape_formulas = true
+ assert_equal true, Axlsx::escape_formulas
+
+ Axlsx::escape_formulas = false
+ assert_equal false, Axlsx::escape_formulas
+
+ Axlsx.instance_variable_set(:@escape_formulas, nil)
+ end
end
diff --git a/test/workbook/tc_workbook.rb b/test/workbook/tc_workbook.rb
index a9bd339c..99ed69f4 100644
--- a/test/workbook/tc_workbook.rb
+++ b/test/workbook/tc_workbook.rb
@@ -164,8 +164,6 @@ class TestWorkbook < Test::Unit::TestCase
end
def test_escape_formulas
- old = Axlsx::escape_formulas
-
Axlsx::escape_formulas = false
p = Axlsx::Package.new
@wb = p.workbook
@@ -196,6 +194,6 @@ class TestWorkbook < Test::Unit::TestCase
assert_false @wb.add_worksheet(escape_formulas: false).escape_formulas
assert @wb.add_worksheet(escape_formulas: true).escape_formulas
- Axlsx::escape_formulas = old
+ Axlsx.instance_variable_set(:@escape_formulas, nil)
end
end