summaryrefslogtreecommitdiffhomepage
path: root/test/doc_props
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-04-13 13:13:34 +0200
committerGeremia Taglialatela <[email protected]>2023-05-03 16:05:17 +0200
commit350f7ae9a04f3d39c099cc54f7c04bf31f385d96 (patch)
treee84af2a70d3b18a0b94c784338faf48215c9c8a8 /test/doc_props
parente81036b76e734ab03fac31faafb9732f6b3b2928 (diff)
downloadcaxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz
caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip
Add RuboCop Minitest
Diffstat (limited to 'test/doc_props')
-rw-r--r--test/doc_props/tc_app.rb3
-rw-r--r--test/doc_props/tc_core.rb9
2 files changed, 8 insertions, 4 deletions
diff --git a/test/doc_props/tc_app.rb b/test/doc_props/tc_app.rb
index cee3e564..94358fc5 100644
--- a/test/doc_props/tc_app.rb
+++ b/test/doc_props/tc_app.rb
@@ -38,6 +38,7 @@ class TestApp < Test::Unit::TestCase
schema.validate(doc).each do |error|
errors << error
end
- assert_equal(errors.size, 0, "app.xml invalid" + errors.map(&:message).to_s)
+
+ assert_equal(0, errors.size, "app.xml invalid" + errors.map(&:message).to_s)
end
end
diff --git a/test/doc_props/tc_core.rb b/test/doc_props/tc_core.rb
index d5412a4f..6aafca3e 100644
--- a/test/doc_props/tc_core.rb
+++ b/test/doc_props/tc_core.rb
@@ -15,7 +15,8 @@ class TestCore < Test::Unit::TestCase
puts error.message
errors << error
end
- assert_equal(errors.size, 0, "core.xml Invalid" + errors.map(&:message).to_s)
+
+ assert_equal(0, errors.size, "core.xml Invalid" + errors.map(&:message).to_s)
end
def test_populates_created
@@ -26,16 +27,18 @@ class TestCore < Test::Unit::TestCase
time = Time.utc(2013, 1, 1, 12, 0)
c = Axlsx::Core.new :created => time
doc = Nokogiri::XML(c.to_xml_string)
+
assert_equal(doc.xpath('//dcterms:created').text, time.xmlschema, "dcterms:created incorrect")
end
def test_populates_default_name
- assert_equal(@doc.xpath('//dc:creator').text, "axlsx", "Default name not populated")
+ assert_equal("axlsx", @doc.xpath('//dc:creator').text, "Default name not populated")
end
def test_creator_as_option
c = Axlsx::Core.new :creator => "some guy"
doc = Nokogiri::XML(c.to_xml_string)
- assert(doc.xpath('//dc:creator').text == "some guy")
+
+ assert_equal("some guy", doc.xpath('//dc:creator').text)
end
end