diff options
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 5 | ||||
| -rw-r--r-- | test/tc_package.rb | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 8b20af94..7134eccb 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -202,9 +202,10 @@ module Axlsx :family, :b, :i, :strike,:outline, :shadow, :condense, :extend, :u, :vertAlign, :sz, :color, :scheme] - v_hash = v.instance_values.select { |k, v| comparable_keys.include? k.to_sym } - self_hash = self.instance_values.select { |k, v| comparable_keys.include? k.to_sym } + #using reject becase 1.8.7 select returns an array... + v_hash = v.instance_values.reject { |k, v| !comparable_keys.include?(k.to_sym) } + self_hash = self.instance_values.reject { |k, v| !comparable_keys.include?(k.to_sym) } # required as color is an object, and the comparison will fail even though both use the same color. v_hash['color'] = v_hash['color'].instance_values if v_hash['color'] self_hash['color'] = self_hash['color'].instance_values if self_hash['color'] diff --git a/test/tc_package.rb b/test/tc_package.rb index 90c3cb84..7057badd 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -91,12 +91,12 @@ class TestPackage < Test::Unit::TestCase def test_base_content_types ct = @package.send(:base_content_types) - assert(ct.select { |ct| ct.ContentType == Axlsx::RELS_CT }.size == 1, "rels content type missing") - assert(ct.select { |ct| ct.ContentType == Axlsx::XML_CT }.size == 1, "xml content type missing") - assert(ct.select { |ct| ct.ContentType == Axlsx::APP_CT }.size == 1, "app content type missing") - assert(ct.select { |ct| ct.ContentType == Axlsx::CORE_CT }.size == 1, "core content type missing") - assert(ct.select { |ct| ct.ContentType == Axlsx::STYLES_CT }.size == 1, "styles content type missing") - assert(ct.select { |ct| ct.ContentType == Axlsx::WORKBOOK_CT }.size == 1, "workbook content type missing") + assert(ct.select { |c| c.ContentType == Axlsx::RELS_CT }.size == 1, "rels content type missing") + assert(ct.select { |c| c.ContentType == Axlsx::XML_CT }.size == 1, "xml content type missing") + assert(ct.select { |c| c.ContentType == Axlsx::APP_CT }.size == 1, "app content type missing") + assert(ct.select { |c| c.ContentType == Axlsx::CORE_CT }.size == 1, "core content type missing") + assert(ct.select { |c| c.ContentType == Axlsx::STYLES_CT }.size == 1, "styles content type missing") + assert(ct.select { |c| c.ContentType == Axlsx::WORKBOOK_CT }.size == 1, "workbook content type missing") assert(ct.size == 6) end |
