summaryrefslogtreecommitdiffhomepage
path: root/test/stylesheet/tc_table_style.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-11-20 23:22:04 +0900
committerRandy Morgan <[email protected]>2011-11-20 23:22:04 +0900
commite53f04284618713b0a90b7a691425c380e829476 (patch)
tree801fea138160f9af426d62bf94ad5bf97123ece9 /test/stylesheet/tc_table_style.rb
downloadcaxlsx-e53f04284618713b0a90b7a691425c380e829476.tar.gz
caxlsx-e53f04284618713b0a90b7a691425c380e829476.zip
first commit
Diffstat (limited to 'test/stylesheet/tc_table_style.rb')
-rw-r--r--test/stylesheet/tc_table_style.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/stylesheet/tc_table_style.rb b/test/stylesheet/tc_table_style.rb
new file mode 100644
index 00000000..54bebb5b
--- /dev/null
+++ b/test/stylesheet/tc_table_style.rb
@@ -0,0 +1,37 @@
+require 'test/unit'
+require 'axlsx.rb'
+
+class TestTableStyle < Test::Unit::TestCase
+
+ def setup
+ @item = Axlsx::TableStyle.new "fisher"
+ end
+
+ def teardown
+ end
+
+ def test_initialiation
+ assert_equal(@item.name, "fisher")
+ assert_equal(@item.pivot, nil)
+ assert_equal(@item.table, nil)
+ end
+
+ def test_name
+ assert_raise(ArgumentError) { @item.name = -1.1 }
+ assert_nothing_raised { @item.name = "lovely table style" }
+ assert_equal(@item.name, "lovely table style")
+ end
+
+ def test_pivot
+ assert_raise(ArgumentError) { @item.pivot = -1.1 }
+ assert_nothing_raised { @item.pivot = true }
+ assert_equal(@item.pivot, true)
+ end
+
+ def test_table
+ assert_raise(ArgumentError) { @item.table = -1.1 }
+ assert_nothing_raised { @item.table = true }
+ assert_equal(@item.table, true)
+ end
+
+end