summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_protected_range.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-06-20 19:26:25 +0900
committerRandy Morgan <[email protected]>2012-06-20 19:26:25 +0900
commit3d3d8e3aba0c49fe5adef5cf1058c3157314b2b2 (patch)
treed22cda14d33f15646a54195abb7b709741650a47 /test/workbook/worksheet/tc_protected_range.rb
parenteb9e1495c31b74ade95cce3b9e5e4c420d66eb02 (diff)
downloadcaxlsx-3d3d8e3aba0c49fe5adef5cf1058c3157314b2b2.tar.gz
caxlsx-3d3d8e3aba0c49fe5adef5cf1058c3157314b2b2.zip
update examples and the beginings of protected_range
Diffstat (limited to 'test/workbook/worksheet/tc_protected_range.rb')
-rw-r--r--test/workbook/worksheet/tc_protected_range.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/workbook/worksheet/tc_protected_range.rb b/test/workbook/worksheet/tc_protected_range.rb
new file mode 100644
index 00000000..6a62f58c
--- /dev/null
+++ b/test/workbook/worksheet/tc_protected_range.rb
@@ -0,0 +1,18 @@
+# encoding: UTF-8
+require 'tc_helper.rb'
+class TestProtectedRange < Test::Unit::TestCase
+def setup
+ @p = Axlsx::Package.new
+ @ws = @p.workbook.add_worksheet { |sheet| sheet.add_row [1,2,3,4,5,6,7,8,9] }
+end
+
+def test_initialize_options
+ assert_nothing_raised {Axlsx::ProtectedRange.new(:sqref => 'A1:B1', :name => "only bob")}
+end
+
+def test_range
+ assert_equal(0, @ws.protected_ranges.size)
+ r = @ws.protect_range('A1:B1')
+ assert_equal('A1:B1', r.sqref)
+end
+end