diff options
| author | Randy Morgan <[email protected]> | 2012-03-23 23:52:34 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-03-23 23:52:34 +0900 |
| commit | ad7119b5927584e4fc735ce72ea69322c3e9acac (patch) | |
| tree | b9ac11d22433f133bb1644b8c26bdd4a0886c555 /test/content_type | |
| parent | cd6fb747bbf2915f92f1fb0169e7f54d87aa1915 (diff) | |
| download | caxlsx-ad7119b5927584e4fc735ce72ea69322c3e9acac.tar.gz caxlsx-ad7119b5927584e4fc735ce72ea69322c3e9acac.zip | |
move requires out of specs and into helper that prepends lib directory for requires
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 | 10 | ||||
| -rw-r--r-- | test/content_type/tc_override.rb | 9 |
3 files changed, 9 insertions, 14 deletions
diff --git a/test/content_type/tc_content_type.rb b/test/content_type/tc_content_type.rb index 5757b980..79141748 100644 --- a/test/content_type/tc_content_type.rb +++ b/test/content_type/tc_content_type.rb @@ -1,7 +1,5 @@ # encoding: UTF-8 - -require 'test/unit' -require 'axlsx.rb' +require 'tc_helper.rb' class TestContentType < Test::Unit::TestCase def setup diff --git a/test/content_type/tc_default.rb b/test/content_type/tc_default.rb index 90c0934e..e5245b38 100644 --- a/test/content_type/tc_default.rb +++ b/test/content_type/tc_default.rb @@ -1,10 +1,8 @@ # encoding: UTF-8 - -require 'test/unit' -require 'axlsx.rb' +require 'tc_helper.rb' class TestDefault < Test::Unit::TestCase - def setup + def setup end def teardown end @@ -19,7 +17,7 @@ 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" } end - + def test_to_xml schema = Nokogiri::XML::Schema(File.open(Axlsx::CONTENT_TYPES_XSD)) type = Axlsx::Default.new :Extension=>"xml", :ContentType=>Axlsx::XML_CT @@ -35,7 +33,7 @@ class TestDefault < Test::Unit::TestCase errors << error end assert_equal(errors.size, 0, "[Content Types].xml Invalid" + errors.map{ |e| e.message }.to_s) - + end diff --git a/test/content_type/tc_override.rb b/test/content_type/tc_override.rb index 911ec649..5005d12d 100644 --- a/test/content_type/tc_override.rb +++ b/test/content_type/tc_override.rb @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- -require 'test/unit' -require 'axlsx.rb' +require 'tc_helper.rb' class TestOverride < Test::Unit::TestCase - def setup + def setup end def teardown end @@ -18,7 +17,7 @@ class TestOverride < Test::Unit::TestCase def test_content_type_restriction assert_raise(ArgumentError, "requires known content type") { Axlsx::Override.new :ContentType=>"asdf" } end - + def test_to_xml schema = Nokogiri::XML::Schema(File.open(Axlsx::CONTENT_TYPES_XSD)) type = Axlsx::Override.new :PartName=>"somechart.xml", :ContentType=>Axlsx::CHART_CT @@ -34,7 +33,7 @@ class TestOverride < Test::Unit::TestCase errors << error end assert_equal(errors.size, 0, "Override content type caused invalid content_type doc" + errors.map{ |e| e.message }.to_s) - + end |
