diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-08 11:53:12 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-04-08 11:53:12 +0200 |
| commit | 55526805cf28cc91a22df5811b26cd23bdefa8d3 (patch) | |
| tree | 2cbc6403b385078b0ed5e275c49f0c60522bdd16 /test/content_type | |
| parent | acf00d356494ef504c3de0e4a0db6b25f2bd7636 (diff) | |
| download | caxlsx-55526805cf28cc91a22df5811b26cd23bdefa8d3.tar.gz caxlsx-55526805cf28cc91a22df5811b26cd23bdefa8d3.zip | |
Fix space-related offenses
- Layout/SpaceAfterComma
- Layout/SpaceAroundEqualsInParameterDefault
- Layout/SpaceAroundOperators
- Layout/SpaceBeforeBlockBraces
- Layout/SpaceInsideBlockBraces
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideParens
Diffstat (limited to 'test/content_type')
| -rw-r--r-- | test/content_type/tc_content_type.rb | 4 | ||||
| -rw-r--r-- | test/content_type/tc_default.rb | 4 | ||||
| -rw-r--r-- | test/content_type/tc_override.rb | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/test/content_type/tc_content_type.rb b/test/content_type/tc_content_type.rb index 278cd67b..f06554c8 100644 --- a/test/content_type/tc_content_type.rb +++ b/test/content_type/tc_content_type.rb @@ -8,7 +8,7 @@ class TestContentType < Test::Unit::TestCase def test_valid_document schema = Nokogiri::XML::Schema(File.open(Axlsx::CONTENT_TYPES_XSD)) - assert(schema.validate(@doc).map{ |e| puts e.message; e.message }.empty?) + assert(schema.validate(@doc).map { |e| puts e.message; e.message }.empty?) end def test_pre_built_types @@ -22,7 +22,7 @@ class TestContentType < Test::Unit::TestCase assert_equal(node["Extension"], "#{Axlsx::XML_EX}", "xml content type invalid") node = @doc.xpath(d_path % Axlsx::RELS_CT).first - assert_equal(node["Extension"],"#{Axlsx::RELS_EX}", "relationships content type invalid") + assert_equal(node["Extension"], "#{Axlsx::RELS_EX}", "relationships content type invalid") #overrride assert_equal(@doc.xpath("//xmlns:Override").size, 4, "There should be 4 Override types") diff --git a/test/content_type/tc_default.rb b/test/content_type/tc_default.rb index 77915ea0..096a117a 100644 --- a/test/content_type/tc_default.rb +++ b/test/content_type/tc_default.rb @@ -2,11 +2,11 @@ require 'tc_helper.rb' class TestDefault < Test::Unit::TestCase def test_content_type_restriction - assert_raise(ArgumentError, "raises argument error if invlalid ContentType is") { Axlsx::Default.new :ContentType=>"asdf" } + assert_raise(ArgumentError, "raises argument error if invlalid ContentType is") { Axlsx::Default.new :ContentType => "asdf" } end def test_to_xml_string - type = Axlsx::Default.new :Extension=>"xml", :ContentType=>Axlsx::XML_CT + type = Axlsx::Default.new :Extension => "xml", :ContentType => Axlsx::XML_CT doc = Nokogiri::XML(type.to_xml_string) assert_equal(doc.xpath("Default[@ContentType='#{Axlsx::XML_CT}']").size, 1) assert_equal(doc.xpath("Default[@Extension='xml']").size, 1) diff --git a/test/content_type/tc_override.rb b/test/content_type/tc_override.rb index c21f9f27..952f40d8 100644 --- a/test/content_type/tc_override.rb +++ b/test/content_type/tc_override.rb @@ -1,11 +1,11 @@ require 'tc_helper.rb' class TestOverride < Test::Unit::TestCase def test_content_type_restriction - assert_raise(ArgumentError, "requires known content type") { Axlsx::Override.new :ContentType=>"asdf" } + assert_raise(ArgumentError, "requires known content type") { Axlsx::Override.new :ContentType => "asdf" } end def test_to_xml - type = Axlsx::Override.new :PartName=>"somechart.xml", :ContentType=>Axlsx::CHART_CT + type = Axlsx::Override.new :PartName => "somechart.xml", :ContentType => Axlsx::CHART_CT doc = Nokogiri::XML(type.to_xml_string) assert_equal(doc.xpath("Override[@ContentType='#{Axlsx::CHART_CT}']").size, 1) assert_equal(doc.xpath("Override[@PartName='somechart.xml']").size, 1) |
