summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-07-20 20:47:41 +0900
committerRandy Morgan <[email protected]>2012-07-20 20:47:41 +0900
commit79ae531c006ad04274aa2f42174be421b35cbfd9 (patch)
treef3e0c760753eb17bad754587a84daf362e23f1c3 /test
parenta8b1ada7409e18ca403ef632972f8921365f331c (diff)
downloadcaxlsx-79ae531c006ad04274aa2f42174be421b35cbfd9.tar.gz
caxlsx-79ae531c006ad04274aa2f42174be421b35cbfd9.zip
bring spec coverage back up to 100%
Diffstat (limited to 'test')
-rw-r--r--test/drawing/tc_d_lbls.rb10
-rw-r--r--test/workbook/worksheet/tc_worksheet.rb4
2 files changed, 13 insertions, 1 deletions
diff --git a/test/drawing/tc_d_lbls.rb b/test/drawing/tc_d_lbls.rb
index 49facd5c..3a61b2e8 100644
--- a/test/drawing/tc_d_lbls.rb
+++ b/test/drawing/tc_d_lbls.rb
@@ -7,12 +7,20 @@ class TestDLbls < Test::Unit::TestCase
end
def test_initialization
- assert_equal(:best_fit, @d_lbls.d_lbl_pos)
+ assert_equal(:bestFit, @d_lbls.d_lbl_pos)
Axlsx::DLbls::BOOLEAN_ATTRIBUTES.each do |attr|
assert_equal(false, @d_lbls.send(attr))
end
end
+ def test_initialization_with_optoins
+ options_hash = Hash[*[Axlsx::DLbls::BOOLEAN_ATTRIBUTES.map { |name| [name, true] }] ]
+ d_lbls = Axlsx::DLbls.new(options_hash.merge( { :d_lbl_pos => :t }))
+ Axlsx::DLbls::BOOLEAN_ATTRIBUTES.each do |attr|
+ assert_equal(true, d_lbls.send(attr), "boolean attributes set by options")
+ end
+ assert_equal(:t, d_lbls.d_lbl_pos, "d_lbl_pos set by options")
+ end
def test_d_lbl_pos
assert_raise(ArgumentError, 'invlaid label positions are rejected') { @d_lbls.d_lbl_pos = :upside_down }
assert_nothing_raised('accepts valid label position') { @d_lbls.d_lbl_pos = :ctr }
diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb
index f5689c13..8147e18e 100644
--- a/test/workbook/worksheet/tc_worksheet.rb
+++ b/test/workbook/worksheet/tc_worksheet.rb
@@ -314,6 +314,10 @@ class TestWorksheet < Test::Unit::TestCase
assert(schema.validate(doc).map{ |e| puts e.message; e }.empty?, "error free validation")
end
+ def test_styles
+ assert(@ws.styles.is_a?(Axlsx::Styles), 'worksheet provides access to styles')
+ end
+
def test_to_xml_string_with_illegal_chars
nasties = "\v\u2028\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u001f"
@ws.add_row [nasties]