summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-02-12 13:21:01 +0900
committerRandy Morgan <[email protected]>2012-02-12 13:21:01 +0900
commit69f005f2030733c12d0d41ab056768a7761c16c0 (patch)
tree08d51e81b5e8825300fcb503563c650c50b5e51a
parent669570ed0be33441da3a128e8eb37aece90e4bdd (diff)
downloadcaxlsx-69f005f2030733c12d0d41ab056768a7761c16c0.tar.gz
caxlsx-69f005f2030733c12d0d41ab056768a7761c16c0.zip
patches for 1.8.7
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb5
-rw-r--r--test/tc_package.rb12
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