mime-types 1.16 → 1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. data/.gemtest +0 -0
  2. data/.hoerc +12 -0
  3. data/{History.txt → History.rdoc} +17 -0
  4. data/Licence.rdoc +10 -0
  5. data/Manifest.txt +36 -6
  6. data/README.rdoc +19 -0
  7. data/Rakefile +138 -255
  8. data/lib/mime/types.rb +117 -25
  9. data/lib/mime/{types.rb.data → types/application} +306 -690
  10. data/lib/mime/types/application.mac +2 -0
  11. data/lib/mime/types/application.nonstandard +114 -0
  12. data/lib/mime/types/application.obsolete +40 -0
  13. data/lib/mime/types/audio +131 -0
  14. data/lib/mime/types/audio.nonstandard +10 -0
  15. data/lib/mime/types/audio.obsolete +1 -0
  16. data/lib/mime/types/image +43 -0
  17. data/lib/mime/types/image.nonstandard +17 -0
  18. data/lib/mime/types/image.obsolete +5 -0
  19. data/lib/mime/types/message +19 -0
  20. data/lib/mime/types/message.obsolete +1 -0
  21. data/lib/mime/types/model +15 -0
  22. data/lib/mime/types/multipart +14 -0
  23. data/lib/mime/types/multipart.nonstandard +1 -0
  24. data/lib/mime/types/multipart.obsolete +7 -0
  25. data/lib/mime/types/other.nonstandard +8 -0
  26. data/lib/mime/types/text +54 -0
  27. data/lib/mime/types/text.nonstandard +5 -0
  28. data/lib/mime/types/text.obsolete +7 -0
  29. data/lib/mime/types/text.vms +1 -0
  30. data/lib/mime/types/video +68 -0
  31. data/lib/mime/types/video.nonstandard +11 -0
  32. data/lib/mime/types/video.obsolete +3 -0
  33. data/mime-types.gemspec +40 -26
  34. data/test/test_mime_type.rb +262 -300
  35. data/test/test_mime_types.rb +74 -97
  36. data/type-lists/application.txt +951 -0
  37. data/type-lists/audio.txt +132 -0
  38. data/type-lists/image.txt +43 -0
  39. data/type-lists/message.txt +20 -0
  40. data/type-lists/model.txt +15 -0
  41. data/type-lists/multipart.txt +14 -0
  42. data/type-lists/text.txt +57 -0
  43. data/type-lists/video.txt +67 -0
  44. metadata +205 -64
  45. data.tar.gz.sig +0 -2
  46. data/Install.txt +0 -17
  47. data/Licence.txt +0 -15
  48. data/README.txt +0 -28
  49. data/setup.rb +0 -1585
  50. metadata.gz.sig +0 -0
@@ -0,0 +1,54 @@
1
+ text/1d-interleaved-parityfec 'IANA,RFC6015
2
+ text/RED 'IANA,RFC4102
3
+ text/calendar 'IANA,RFC5545
4
+ text/css @css :8bit 'IANA,RFC2318
5
+ text/csv @csv :8bit 'IANA,RFC4180
6
+ text/dns 'IANA,RFC4027
7
+ text/enriched 'IANA,RFC1896
8
+ text/example 'IANA,RFC4735
9
+ text/fwdred 'IANA,RFC6354
10
+ text/html @html,htm,htmlx,shtml,htx :8bit 'IANA,RFC2854
11
+ text/n3 'IANA,[Prud'hommeaux=Prudhommeaux],[W3C]
12
+ text/parityfec 'IANA,RFC5109
13
+ text/plain @txt,asc,c,cc,h,hh,cpp,hpp,dat,hlp 'IANA,RFC2046,RFC3676,RFC5147
14
+ text/prs.fallenstein.rst @rst 'IANA,[Fallenstein]
15
+ text/prs.lines.tag 'IANA,[Lines]
16
+ text/rfc822-headers 'IANA,RFC3462
17
+ text/richtext @rtx :8bit 'IANA,RFC2045,RFC2046
18
+ text/rtf @rtf :8bit 'IANA,[Lindner]
19
+ text/rtp-enc-aescm128 'IANA,[3GPP]
20
+ text/rtx 'IANA,RFC4588
21
+ text/sgml @sgml,sgm 'IANA,RFC1874
22
+ text/t140 'IANA,RFC4103
23
+ text/tab-separated-values @tsv 'IANA,[Lindner]
24
+ text/troff @t,tr,roff,troff :8bit 'IANA,RFC4263
25
+ text/turtle 'IANA,[Prud'hommeaux=Prudhommeaux],[W3C]
26
+ text/ulpfec 'IANA,RFC5109
27
+ text/uri-list 'IANA,RFC2483
28
+ text/vcard 'IANA,RFC6350
29
+ text/vnd.DMClientScript 'IANA,[Bradley]
30
+ text/vnd.IPTC.NITF 'IANA,[IPTC]
31
+ text/vnd.IPTC.NewsML 'IANA,[IPTC]
32
+ text/vnd.abc 'IANA,[Allen]
33
+ text/vnd.curl 'IANA,[Byrnes]
34
+ text/vnd.dvb.subtitle 'IANA,[Siebert],[Lagally]
35
+ text/vnd.esmertec.theme-descriptor 'IANA,[Eilemann]
36
+ text/vnd.fly 'IANA,[Gurney]
37
+ text/vnd.fmi.flexstor 'IANA,[Hurtta]
38
+ text/vnd.graphviz 'IANA,[Ellson]
39
+ text/vnd.in3d.3dml 'IANA,[Powers]
40
+ text/vnd.in3d.spot 'IANA,[Powers]
41
+ text/vnd.latex-z 'IANA,[Lubos]
42
+ text/vnd.motorola.reflex 'IANA,[Patton]
43
+ text/vnd.ms-mediapackage 'IANA,[Nelson]
44
+ text/vnd.net2phone.commcenter.command @ccc 'IANA,[Xie]
45
+ text/vnd.radisys.msml-basic-layout 'IANA,RFC5707
46
+ text/vnd.si.uricatalogue 'IANA,[Parks Young=ParksYoung]
47
+ text/vnd.sun.j2me.app-descriptor @jad :8bit 'IANA,[G.Adams]
48
+ text/vnd.trolltech.linguist 'IANA,[D.Lambert]
49
+ text/vnd.wap.si @si 'IANA,[WAP-Forum]
50
+ text/vnd.wap.sl @sl 'IANA,[WAP-Forum]
51
+ text/vnd.wap.wml @wml 'IANA,[Stark]
52
+ text/vnd.wap.wmlscript @wmls 'IANA,[Stark]
53
+ text/xml @xml,dtd :8bit 'IANA,RFC3023
54
+ text/xml-external-parsed-entity 'IANA,RFC3023
@@ -0,0 +1,5 @@
1
+ text/x-component @htc :8bit
2
+ text/x-setext @etx
3
+ text/x-vcalendar @vcs :8bit
4
+ text/x-vcard @vcf :8bit
5
+ text/x-yaml @yaml,yml :8bit
@@ -0,0 +1,7 @@
1
+ !text/directory 'IANA,RFC2425,RFC6350
2
+ !text/ecmascript 'IANA,RFC4329
3
+ !text/javascript 'IANA,RFC4329
4
+ !text/x-rtf @rtf :8bit =use-instead:text/rtf
5
+ !text/x-vnd.flatland.3dml =use-instead:model/vnd.flatland.3dml
6
+ *!text/comma-separated-values @csv :8bit =use-instead:text/csv
7
+ *!text/vnd.flatland.3dml =use-instead:model/vnd.flatland.3dml
@@ -0,0 +1 @@
1
+ vms:text/plain @doc :8bit
@@ -0,0 +1,68 @@
1
+ video/1d-interleaved-parityfec 'IANA,RFC6015
2
+ video/3gpp @3gp,3gpp 'IANA,RFC3839,RFC6381
3
+ video/3gpp-tt 'IANA,RFC4396
4
+ video/3gpp2 'IANA,RFC4393,RFC6381
5
+ video/BMPEG 'IANA,RFC3555
6
+ video/BT656 'IANA,RFC3555
7
+ video/CelB 'IANA,RFC3555
8
+ video/DV 'IANA,RFC3189
9
+ video/H261 'IANA,RFC4587
10
+ video/H263 'IANA,RFC3555
11
+ video/H263-1998 'IANA,RFC4629
12
+ video/H263-2000 'IANA,RFC4629
13
+ video/H264 'IANA,RFC6184
14
+ video/H264-RCDO 'IANA,RFC6185
15
+ video/H264-SVC 'IANA,RFC6190
16
+ video/JPEG 'IANA,RFC3555
17
+ video/MJ2 @mj2,mjp2 'IANA,RFC3745
18
+ video/MP1S 'IANA,RFC3555
19
+ video/MP2P 'IANA,RFC3555
20
+ video/MP2T 'IANA,RFC3555
21
+ video/MP4V-ES 'IANA,RFC6416
22
+ video/MPV 'IANA,RFC3555
23
+ video/SMPTE292M 'IANA,RFC3497
24
+ video/example 'IANA,RFC4735
25
+ video/jpeg2000 'IANA,RFC5371,RFC5372
26
+ video/mp4 @mp4,mpg4 'IANA,RFC4337,RFC6381
27
+ video/mpeg @mp2,mpe,mp3g,mpg :base64 'IANA,RFC2045,RFC2046
28
+ video/mpeg4-generic 'IANA,RFC3640
29
+ video/nv 'IANA,RFC4856
30
+ video/ogg @ogv 'IANA,RFC5334
31
+ video/parityfec 'IANA,RFC5109
32
+ video/pointer 'IANA,RFC2862
33
+ video/quicktime @qt,mov :base64 'IANA,[Lindner]
34
+ video/raw 'IANA,RFC4175
35
+ video/rtp-enc-aescm128 'IANA,[3GPP]
36
+ video/rtx 'IANA,RFC4588
37
+ video/ulpfec 'IANA,RFC5109
38
+ video/vc1 'IANA,RFC4425
39
+ video/vnd.CCTV 'IANA,[Rottmann]
40
+ video/vnd.dece.hd 'IANA,[Dolan]
41
+ video/vnd.dece.mobile 'IANA,[Dolan]
42
+ video/vnd.dece.mp4 'IANA,[Dolan]
43
+ video/vnd.dece.pd 'IANA,[Dolan]
44
+ video/vnd.dece.sd 'IANA,[Dolan]
45
+ video/vnd.dece.video 'IANA,[Dolan]
46
+ video/vnd.directv.mpeg 'IANA,[Zerbe]
47
+ video/vnd.dvb.file 'IANA,[Siebert],[Murray]
48
+ video/vnd.fvt 'IANA,[Fuldseth]
49
+ video/vnd.hns.video 'IANA,[Swaminathan]
50
+ video/vnd.iptvforum.1dparityfec-1010 'IANA,[Nakamura]
51
+ video/vnd.iptvforum.1dparityfec-2005 'IANA,[Nakamura]
52
+ video/vnd.iptvforum.2dparityfec-1010 'IANA,[Nakamura]
53
+ video/vnd.iptvforum.2dparityfec-2005 'IANA,[Nakamura]
54
+ video/vnd.iptvforum.ttsavc 'IANA,[Nakamura]
55
+ video/vnd.iptvforum.ttsmpeg2 'IANA,[Nakamura]
56
+ video/vnd.motorola.video 'IANA,[McGinty]
57
+ video/vnd.motorola.videop 'IANA,[McGinty]
58
+ video/vnd.mpegurl @mxu,m4u :8bit 'IANA,[Recktenwald]
59
+ video/vnd.ms-playready.media.pyv 'IANA,[DiAcetis]
60
+ video/vnd.nokia.interleaved-multimedia @nim 'IANA,[Kangaslampi]
61
+ video/vnd.nokia.videovoip 'IANA,[Nokia]
62
+ video/vnd.objectvideo @mp4 'IANA,[Clark]
63
+ video/vnd.sealed.mpeg1 @s11 'IANA,[Petersen]
64
+ video/vnd.sealed.mpeg4 @smpg,s14 'IANA,[Petersen]
65
+ video/vnd.sealed.swf @sswf,ssw 'IANA,[Petersen]
66
+ video/vnd.sealedmedia.softseal.mov @smov,smo,s1q 'IANA,[Petersen]
67
+ video/vnd.uvvu.mp4 'IANA,[Dolan]
68
+ video/vnd.vivo @viv,vivo 'IANA,[Wolfe]
@@ -0,0 +1,11 @@
1
+ video/x-dl @dl :base64
2
+ video/x-fli @fli :base64
3
+ video/x-flv @flv :base64
4
+ video/x-gl @gl :base64
5
+ video/x-ms-asf @asf,asx
6
+ video/x-ms-wm @wm
7
+ video/x-ms-wmv @wmv
8
+ video/x-ms-wmx @wmx
9
+ video/x-ms-wvx @wvx
10
+ video/x-msvideo @avi :base64
11
+ video/x-sgi-movie @movie :base64
@@ -0,0 +1,3 @@
1
+ *!video/dl @dl :base64 =use-instead:video/x-dl
2
+ *!video/gl @gl :base64 =use-instead:video/x-gl
3
+ *!video/vnd.dlna.mpeg-tts 'IANA,[Heredia]
@@ -1,43 +1,57 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = %q{mime-types}
5
- s.version = "1.16"
4
+ s.name = "mime-types"
5
+ s.version = "1.16.20111022003230"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Austin Ziegler"]
9
- s.cert_chain = ["/Users/austin/.gem/gem-public_cert.pem"]
10
- s.date = %q{2009-03-01}
11
- s.description = %q{MIME::Types for Ruby originally based on and synchronized with MIME::Types for Perl by Mark Overmeer, copyright 2001 - 2009. As of version 1.15, the data format for the MIME::Type list has changed and the synchronization will no longer happen.}
9
+ s.date = "2011-10-22"
10
+ s.description = "This library allows for the identification of a file's likely MIME content\ntype. This is release 1.17. The identification of MIME content type is based\non a file's filename extensions.\n\nMIME::Types for Ruby originally based on and synchronized with MIME::Types for\nPerl by Mark Overmeer, copyright 2001 - 2009. As of version 1.15, the data\nformat for the MIME::Type list has changed and the synchronization will no\nlonger happen.\n\nHomepage:: http://mime-types.rubyforge.org/\nCopyright:: 2002 - 2011, Austin Ziegler\n Based in part on prior work copyright Mark Overmeer\n\n:include: License.rdoc"
12
11
  s.email = ["austin@rubyforge.org"]
13
- s.extra_rdoc_files = ["History.txt", "Install.txt", "Licence.txt", "README.txt"]
14
- s.files = ["History.txt", "Install.txt", "Licence.txt", "Manifest.txt", "README.txt", "Rakefile", "lib/mime/types.rb", "lib/mime/types.rb.data", "setup.rb", "test/test_mime_type.rb", "test/test_mime_types.rb"]
15
- s.has_rdoc = true
16
- s.homepage = %q{http://mime-types.rubyforge.org/}
17
- s.rdoc_options = ["--main", "README.txt"]
12
+ s.extra_rdoc_files = ["History.txt", "Install.txt", "Licence.txt", "Manifest.txt", "README.txt", "History.rdoc", "Licence.rdoc", "README.rdoc"]
13
+ s.files = ["History.txt", "Install.txt", "Licence.txt", "Manifest.txt", "README.txt", "Rakefile", "lib/mime/types.rb", "lib/mime/types.rb.data", "mime-types.gemspec", "setup.rb", "test/test_mime_type.rb", "test/test_mime_types.rb", "History.rdoc", "Licence.rdoc", "README.rdoc", ".gemtest"]
14
+ s.homepage = "http://mime-types.rubyforge.org/"
15
+ s.rdoc_options = ["--main", "README.rdoc"]
18
16
  s.require_paths = ["lib"]
19
- s.rubyforge_project = %q{mime-types}
20
- s.rubygems_version = %q{1.3.1}
21
- s.signing_key = %q{/Users/austin/.gem/gem-private_key.pem}
22
- s.summary = %q{Manages a MIME Content-Type database that will return the Content-Type for a given filename.}
17
+ s.rubyforge_project = "mime-types"
18
+ s.rubygems_version = "1.8.10"
19
+ s.summary = "This library allows for the identification of a file's likely MIME content type"
23
20
  s.test_files = ["test/test_mime_type.rb", "test/test_mime_types.rb"]
24
21
 
25
22
  if s.respond_to? :specification_version then
26
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
- s.specification_version = 2
23
+ s.specification_version = 3
28
24
 
29
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
- s.add_development_dependency(%q<archive-tar-minitar>, ["~> 0.5.1"])
31
- s.add_development_dependency(%q<nokogiri>, ["~> 1.2.1"])
32
- s.add_development_dependency(%q<hoe>, [">= 1.8.3"])
25
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
+ s.add_development_dependency(%q<rubyforge>, [">= 2.0.4"])
27
+ s.add_development_dependency(%q<minitest>, [">= 2.6.2"])
28
+ s.add_development_dependency(%q<nokogiri>, ["~> 1.2"])
29
+ s.add_development_dependency(%q<minitest>, ["~> 2.0"])
30
+ s.add_development_dependency(%q<hoe-doofus>, ["~> 1.0"])
31
+ s.add_development_dependency(%q<hoe-gemspec>, ["~> 1.0"])
32
+ s.add_development_dependency(%q<hoe-git>, ["~> 1.0"])
33
+ s.add_development_dependency(%q<hoe-seattlerb>, ["~> 1.0"])
34
+ s.add_development_dependency(%q<hoe>, ["~> 2.12"])
33
35
  else
34
- s.add_dependency(%q<archive-tar-minitar>, ["~> 0.5.1"])
35
- s.add_dependency(%q<nokogiri>, ["~> 1.2.1"])
36
- s.add_dependency(%q<hoe>, [">= 1.8.3"])
36
+ s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
37
+ s.add_dependency(%q<minitest>, [">= 2.6.2"])
38
+ s.add_dependency(%q<nokogiri>, ["~> 1.2"])
39
+ s.add_dependency(%q<minitest>, ["~> 2.0"])
40
+ s.add_dependency(%q<hoe-doofus>, ["~> 1.0"])
41
+ s.add_dependency(%q<hoe-gemspec>, ["~> 1.0"])
42
+ s.add_dependency(%q<hoe-git>, ["~> 1.0"])
43
+ s.add_dependency(%q<hoe-seattlerb>, ["~> 1.0"])
44
+ s.add_dependency(%q<hoe>, ["~> 2.12"])
37
45
  end
38
46
  else
39
- s.add_dependency(%q<archive-tar-minitar>, ["~> 0.5.1"])
40
- s.add_dependency(%q<nokogiri>, ["~> 1.2.1"])
41
- s.add_dependency(%q<hoe>, [">= 1.8.3"])
47
+ s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
48
+ s.add_dependency(%q<minitest>, [">= 2.6.2"])
49
+ s.add_dependency(%q<nokogiri>, ["~> 1.2"])
50
+ s.add_dependency(%q<minitest>, ["~> 2.0"])
51
+ s.add_dependency(%q<hoe-doofus>, ["~> 1.0"])
52
+ s.add_dependency(%q<hoe-gemspec>, ["~> 1.0"])
53
+ s.add_dependency(%q<hoe-git>, ["~> 1.0"])
54
+ s.add_dependency(%q<hoe-seattlerb>, ["~> 1.0"])
55
+ s.add_dependency(%q<hoe>, ["~> 2.12"])
42
56
  end
43
57
  end
@@ -1,313 +1,276 @@
1
- #! /usr/bin/env ruby
2
- #--
3
- # MIME::Types
4
- # A Ruby implementation of a MIME Types information library. Based in spirit
5
- # on the Perl MIME::Types information library by Mark Overmeer.
6
- # http://rubyforge.org/projects/mime-types/
7
- #
8
- # Licensed under the Ruby disjunctive licence with the GNU GPL or the Perl
9
- # Artistic licence. See Licence.txt for more information.
10
- #
11
- # Copyright 2003 - 2009 Austin Ziegler
12
- #++
13
1
  $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
14
2
 
15
3
  require 'mime/types'
16
- require 'test/unit' unless defined? $ZENTEST and $ZENTEST
4
+ require 'minitest/autorun'
5
+ #require 'test/unit' unless defined? $ZENTEST and $ZENTEST
17
6
 
18
- module TestMIME
19
- class TestType < Test::Unit::TestCase #:nodoc:
20
- def setup
21
- @zip = MIME::Type.new('x-appl/x-zip') { |t| t.extensions = ['zip', 'zp'] }
22
- end
7
+ class TestMIME_Type < MiniTest::Unit::TestCase
8
+ def yaml_mime_type_from_array
9
+ yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit', 'linux')
10
+ end
23
11
 
24
- def test_class_from_array
25
- assert_nothing_raised do
26
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit', 'linux')
27
- end
28
- assert_instance_of(MIME::Type, @yaml)
29
- assert_equal('text/yaml', @yaml.simplified)
30
- end
12
+ def setup
13
+ @zip = MIME::Type.new('x-appl/x-zip') { |t| t.extensions = ['zip', 'zp'] }
14
+ end
31
15
 
32
- def test_class_from_hash
33
- assert_nothing_raised do
34
- @yaml = MIME::Type.from_hash('Content-Type' => 'text/x-yaml',
35
- 'Content-Transfer-Encoding' => '8bit',
36
- 'System' => 'linux',
37
- 'Extensions' => %w(yaml yml))
38
- end
39
- assert_instance_of(MIME::Type, @yaml)
40
- assert_equal('text/yaml', @yaml.simplified)
41
- end
16
+ def test_class_from_array
17
+ yaml = yaml_mime_type_from_array
18
+ assert_instance_of(MIME::Type, yaml)
19
+ assert_equal('text/yaml', yaml.simplified)
20
+ end
42
21
 
43
- def test_class_from_mime_type
44
- assert_nothing_raised do
45
- @zip2 = MIME::Type.from_mime_type(@zip)
46
- end
47
- assert_instance_of(MIME::Type, @zip)
48
- assert_equal('appl/zip', @zip.simplified)
49
- assert_not_equal(@zip.object_id, @zip2.object_id)
50
- end
22
+ def test_class_from_hash
23
+ yaml = MIME::Type.from_hash('Content-Type' => 'text/x-yaml',
24
+ 'Content-Transfer-Encoding' => '8bit',
25
+ 'System' => 'linux',
26
+ 'Extensions' => %w(yaml yml))
27
+ assert_instance_of(MIME::Type, yaml)
28
+ assert_equal('text/yaml', yaml.simplified)
29
+ end
51
30
 
52
- def test_class_simplified
53
- assert_equal(MIME::Type.simplified('text/plain'), 'text/plain')
54
- assert_equal(MIME::Type.simplified('image/jpeg'), 'image/jpeg')
55
- assert_equal(MIME::Type.simplified('application/x-msword'), 'application/msword')
56
- assert_equal(MIME::Type.simplified('text/vCard'), 'text/vcard')
57
- assert_equal(MIME::Type.simplified('application/pkcs7-mime'), 'application/pkcs7-mime')
58
- assert_equal(@zip.simplified, 'appl/zip')
59
- assert_equal(MIME::Type.simplified('x-xyz/abc'), 'xyz/abc')
60
- end
31
+ def test_class_from_mime_type
32
+ zip2 = MIME::Type.from_mime_type(@zip)
33
+ assert_instance_of(MIME::Type, @zip)
34
+ assert_equal('appl/zip', @zip.simplified)
35
+ refute_equal(@zip.object_id, zip2.object_id)
36
+ end
61
37
 
62
- def test_CMP # '<=>'
63
- assert(MIME::Type.new('text/plain') == MIME::Type.new('text/plain'))
64
- assert(MIME::Type.new('text/plain') != MIME::Type.new('image/jpeg'))
65
- assert(MIME::Type.new('text/plain') == 'text/plain')
66
- assert(MIME::Type.new('text/plain') != 'image/jpeg')
67
- assert(MIME::Type.new('text/plain') > MIME::Type.new('text/html'))
68
- assert(MIME::Type.new('text/plain') > 'text/html')
69
- assert(MIME::Type.new('text/html') < MIME::Type.new('text/plain'))
70
- assert(MIME::Type.new('text/html') < 'text/plain')
71
- assert('text/html' == MIME::Type.new('text/html'))
72
- assert('text/html' < MIME::Type.new('text/plain'))
73
- assert('text/plain' > MIME::Type.new('text/html'))
74
- end
38
+ def test_class_simplified
39
+ assert_equal(MIME::Type.simplified('text/plain'), 'text/plain')
40
+ assert_equal(MIME::Type.simplified('image/jpeg'), 'image/jpeg')
41
+ assert_equal(MIME::Type.simplified('application/x-msword'), 'application/msword')
42
+ assert_equal(MIME::Type.simplified('text/vCard'), 'text/vcard')
43
+ assert_equal(MIME::Type.simplified('application/pkcs7-mime'), 'application/pkcs7-mime')
44
+ assert_equal(@zip.simplified, 'appl/zip')
45
+ assert_equal(MIME::Type.simplified('x-xyz/abc'), 'xyz/abc')
46
+ end
75
47
 
76
- def test_ascii_eh
77
- assert(MIME::Type.new('text/plain').ascii?)
78
- assert(!MIME::Type.new('image/jpeg').ascii?)
79
- assert(!MIME::Type.new('application/x-msword').ascii?)
80
- assert(MIME::Type.new('text/vCard').ascii?)
81
- assert(!MIME::Type.new('application/pkcs7-mime').ascii?)
82
- assert(!@zip.ascii?)
83
- end
48
+ def test_CMP # '<=>'
49
+ assert(MIME::Type.new('text/plain') == MIME::Type.new('text/plain'))
50
+ assert(MIME::Type.new('text/plain') != MIME::Type.new('image/jpeg'))
51
+ assert(MIME::Type.new('text/plain') == 'text/plain')
52
+ assert(MIME::Type.new('text/plain') != 'image/jpeg')
53
+ assert(MIME::Type.new('text/plain') > MIME::Type.new('text/html'))
54
+ assert(MIME::Type.new('text/plain') > 'text/html')
55
+ assert(MIME::Type.new('text/html') < MIME::Type.new('text/plain'))
56
+ assert(MIME::Type.new('text/html') < 'text/plain')
57
+ assert('text/html' == MIME::Type.new('text/html'))
58
+ assert('text/html' < MIME::Type.new('text/plain'))
59
+ assert('text/plain' > MIME::Type.new('text/html'))
60
+ end
84
61
 
85
- def test_binary_eh
86
- assert(!MIME::Type.new('text/plain').binary?)
87
- assert(MIME::Type.new('image/jpeg').binary?)
88
- assert(MIME::Type.new('application/x-msword').binary?)
89
- assert(!MIME::Type.new('text/vCard').binary?)
90
- assert(MIME::Type.new('application/pkcs7-mime').binary?)
91
- assert(@zip.binary?)
92
- end
62
+ def test_ascii_eh
63
+ assert(MIME::Type.new('text/plain').ascii?)
64
+ refute(MIME::Type.new('image/jpeg').ascii?)
65
+ refute(MIME::Type.new('application/x-msword').ascii?)
66
+ assert(MIME::Type.new('text/vCard').ascii?)
67
+ refute(MIME::Type.new('application/pkcs7-mime').ascii?)
68
+ refute(@zip.ascii?)
69
+ end
93
70
 
94
- def test_complete_eh
95
- assert_nothing_raised do
96
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit',
97
- 'linux')
98
- end
99
- assert(@yaml.complete?)
100
- assert_nothing_raised { @yaml.extensions = nil }
101
- assert(!@yaml.complete?)
102
- end
71
+ def test_binary_eh
72
+ refute(MIME::Type.new('text/plain').binary?)
73
+ assert(MIME::Type.new('image/jpeg').binary?)
74
+ assert(MIME::Type.new('application/x-msword').binary?)
75
+ refute(MIME::Type.new('text/vCard').binary?)
76
+ assert(MIME::Type.new('application/pkcs7-mime').binary?)
77
+ assert(@zip.binary?)
78
+ end
103
79
 
104
- def test_content_type
105
- assert_equal(MIME::Type.new('text/plain').content_type, 'text/plain')
106
- assert_equal(MIME::Type.new('image/jpeg').content_type, 'image/jpeg')
107
- assert_equal(MIME::Type.new('application/x-msword').content_type, 'application/x-msword')
108
- assert_equal(MIME::Type.new('text/vCard').content_type, 'text/vCard')
109
- assert_equal(MIME::Type.new('application/pkcs7-mime').content_type, 'application/pkcs7-mime')
110
- assert_equal(@zip.content_type, 'x-appl/x-zip');
111
- end
80
+ def test_complete_eh
81
+ yaml = yaml_mime_type_from_array
82
+ assert(yaml.complete?)
83
+ yaml.extensions = nil
84
+ refute(yaml.complete?)
85
+ end
112
86
 
113
- def test_encoding
114
- assert_equal(MIME::Type.new('text/plain').encoding, 'quoted-printable')
115
- assert_equal(MIME::Type.new('image/jpeg').encoding, 'base64')
116
- assert_equal(MIME::Type.new('application/x-msword').encoding, 'base64')
117
- assert_equal(MIME::Type.new('text/vCard').encoding, 'quoted-printable')
118
- assert_equal(MIME::Type.new('application/pkcs7-mime').encoding, 'base64')
119
- assert_nothing_raised do
120
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit',
121
- 'linux')
122
- end
123
- assert_equal(@yaml.encoding, '8bit')
124
- assert_nothing_raised { @yaml.encoding = 'base64' }
125
- assert_equal(@yaml.encoding, 'base64')
126
- assert_nothing_raised { @yaml.encoding = :default }
127
- assert_equal(@yaml.encoding, 'quoted-printable')
128
- assert_raises(ArgumentError) { @yaml.encoding = 'binary' }
129
- assert_equal(@zip.encoding, 'base64')
130
- end
87
+ def test_content_type
88
+ assert_equal(MIME::Type.new('text/plain').content_type, 'text/plain')
89
+ assert_equal(MIME::Type.new('image/jpeg').content_type, 'image/jpeg')
90
+ assert_equal(MIME::Type.new('application/x-msword').content_type, 'application/x-msword')
91
+ assert_equal(MIME::Type.new('text/vCard').content_type, 'text/vCard')
92
+ assert_equal(MIME::Type.new('application/pkcs7-mime').content_type, 'application/pkcs7-mime')
93
+ assert_equal(@zip.content_type, 'x-appl/x-zip');
94
+ end
131
95
 
132
- def _test_default_encoding
133
- raise NotImplementedError, 'Need to write test_default_encoding'
134
- end
96
+ def test_encoding
97
+ assert_equal(MIME::Type.new('text/plain').encoding, 'quoted-printable')
98
+ assert_equal(MIME::Type.new('image/jpeg').encoding, 'base64')
99
+ assert_equal(MIME::Type.new('application/x-msword').encoding, 'base64')
100
+ assert_equal(MIME::Type.new('text/vCard').encoding, 'quoted-printable')
101
+ assert_equal(MIME::Type.new('application/pkcs7-mime').encoding, 'base64')
102
+
103
+ yaml = yaml_mime_type_from_array
104
+ assert_equal(yaml.encoding, '8bit')
105
+ yaml.encoding = 'base64'
106
+ assert_equal(yaml.encoding, 'base64')
107
+ yaml.encoding = :default
108
+ assert_equal(yaml.encoding, 'quoted-printable')
109
+ assert_raises(ArgumentError) { yaml.encoding = 'binary' }
110
+ assert_equal(@zip.encoding, 'base64')
111
+ end
135
112
 
136
- def _test_docs
137
- raise NotImplementedError, 'Need to write test_docs'
138
- end
113
+ def _test_default_encoding
114
+ raise NotImplementedError, 'Need to write test_default_encoding'
115
+ end
139
116
 
140
- def _test_docs_equals
141
- raise NotImplementedError, 'Need to write test_docs_equals'
142
- end
117
+ def _test_docs
118
+ raise NotImplementedError, 'Need to write test_docs'
119
+ end
143
120
 
144
- def test_eql?
145
- assert(MIME::Type.new('text/plain').eql?(MIME::Type.new('text/plain')))
146
- assert(!MIME::Type.new('text/plain').eql?(MIME::Type.new('image/jpeg')))
147
- assert(!MIME::Type.new('text/plain').eql?('text/plain'))
148
- assert(!MIME::Type.new('text/plain').eql?('image/jpeg'))
149
- end
121
+ def _test_docs_equals
122
+ raise NotImplementedError, 'Need to write test_docs_equals'
123
+ end
150
124
 
151
- def _test_encoding
152
- raise NotImplementedError, 'Need to write test_encoding'
153
- end
125
+ def test_eql?
126
+ assert(MIME::Type.new('text/plain').eql?(MIME::Type.new('text/plain')))
127
+ refute(MIME::Type.new('text/plain').eql?(MIME::Type.new('image/jpeg')))
128
+ refute(MIME::Type.new('text/plain').eql?('text/plain'))
129
+ refute(MIME::Type.new('text/plain').eql?('image/jpeg'))
130
+ end
154
131
 
155
- def _test_encoding_equals
156
- raise NotImplementedError, 'Need to write test_encoding_equals'
157
- end
132
+ def _test_encoding
133
+ raise NotImplementedError, 'Need to write test_encoding'
134
+ end
158
135
 
159
- def test_extensions
160
- assert_nothing_raised do
161
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit',
162
- 'linux')
163
- end
164
- assert_equal(@yaml.extensions, %w(yaml yml))
165
- assert_nothing_raised { @yaml.extensions = 'yaml' }
166
- assert_equal(@yaml.extensions, ['yaml'])
167
- assert_equal(@zip.extensions.size, 2)
168
- assert_equal(@zip.extensions, ['zip', 'zp'])
169
- end
136
+ def _test_encoding_equals
137
+ raise NotImplementedError, 'Need to write test_encoding_equals'
138
+ end
170
139
 
171
- def _test_extensions_equals
172
- raise NotImplementedError, 'Need to write test_extensions_equals'
173
- end
140
+ def test_extensions
141
+ yaml = yaml_mime_type_from_array
142
+ assert_equal(yaml.extensions, %w(yaml yml))
143
+ yaml.extensions = 'yaml'
144
+ assert_equal(yaml.extensions, ['yaml'])
145
+ assert_equal(@zip.extensions.size, 2)
146
+ assert_equal(@zip.extensions, ['zip', 'zp'])
147
+ end
174
148
 
175
- def test_like_eh
176
- assert(MIME::Type.new('text/plain').like?(MIME::Type.new('text/plain')))
177
- assert(MIME::Type.new('text/plain').like?(MIME::Type.new('text/x-plain')))
178
- assert(!MIME::Type.new('text/plain').like?(MIME::Type.new('image/jpeg')))
179
- assert(MIME::Type.new('text/plain').like?('text/plain'))
180
- assert(MIME::Type.new('text/plain').like?('text/x-plain'))
181
- assert(!MIME::Type.new('text/plain').like?('image/jpeg'))
182
- end
149
+ def _test_extensions_equals
150
+ raise NotImplementedError, 'Need to write test_extensions_equals'
151
+ end
183
152
 
184
- def test_media_type
185
- assert_equal(MIME::Type.new('text/plain').media_type, 'text')
186
- assert_equal(MIME::Type.new('image/jpeg').media_type, 'image')
187
- assert_equal(MIME::Type.new('application/x-msword').media_type, 'application')
188
- assert_equal(MIME::Type.new('text/vCard').media_type, 'text')
189
- assert_equal(MIME::Type.new('application/pkcs7-mime').media_type, 'application')
190
- assert_equal(MIME::Type.new('x-chemical/x-pdb').media_type, 'chemical')
191
- assert_equal(@zip.media_type, 'appl')
192
- end
153
+ def test_like_eh
154
+ assert(MIME::Type.new('text/plain').like?(MIME::Type.new('text/plain')))
155
+ assert(MIME::Type.new('text/plain').like?(MIME::Type.new('text/x-plain')))
156
+ refute(MIME::Type.new('text/plain').like?(MIME::Type.new('image/jpeg')))
157
+ assert(MIME::Type.new('text/plain').like?('text/plain'))
158
+ assert(MIME::Type.new('text/plain').like?('text/x-plain'))
159
+ refute(MIME::Type.new('text/plain').like?('image/jpeg'))
160
+ end
193
161
 
194
- def _test_obsolete_eh
195
- raise NotImplementedError, 'Need to write test_obsolete_eh'
196
- end
162
+ def test_media_type
163
+ assert_equal(MIME::Type.new('text/plain').media_type, 'text')
164
+ assert_equal(MIME::Type.new('image/jpeg').media_type, 'image')
165
+ assert_equal(MIME::Type.new('application/x-msword').media_type, 'application')
166
+ assert_equal(MIME::Type.new('text/vCard').media_type, 'text')
167
+ assert_equal(MIME::Type.new('application/pkcs7-mime').media_type, 'application')
168
+ assert_equal(MIME::Type.new('x-chemical/x-pdb').media_type, 'chemical')
169
+ assert_equal(@zip.media_type, 'appl')
170
+ end
197
171
 
198
- def _test_obsolete_equals
199
- raise NotImplementedError, 'Need to write test_obsolete_equals'
200
- end
172
+ def _test_obsolete_eh
173
+ raise NotImplementedError, 'Need to write test_obsolete_eh'
174
+ end
201
175
 
202
- def test_platform_eh
203
- assert_nothing_raised do
204
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit',
205
- 'oddbox')
206
- end
207
- assert(!@yaml.platform?)
208
- assert_nothing_raised { @yaml.system = nil }
209
- assert(!@yaml.platform?)
210
- assert_nothing_raised { @yaml.system = /#{RUBY_PLATFORM}/ }
211
- assert(@yaml.platform?)
212
- end
176
+ def _test_obsolete_equals
177
+ raise NotImplementedError, 'Need to write test_obsolete_equals'
178
+ end
213
179
 
214
- def test_raw_media_type
215
- assert_equal(MIME::Type.new('text/plain').raw_media_type, 'text')
216
- assert_equal(MIME::Type.new('image/jpeg').raw_media_type, 'image')
217
- assert_equal(MIME::Type.new('application/x-msword').raw_media_type, 'application')
218
- assert_equal(MIME::Type.new('text/vCard').raw_media_type, 'text')
219
- assert_equal(MIME::Type.new('application/pkcs7-mime').raw_media_type, 'application')
180
+ def test_platform_eh
181
+ yaml = yaml_mime_type_from_array
182
+ refute(yaml.platform?)
183
+ yaml.system = nil
184
+ refute(yaml.platform?)
185
+ yaml.system = %r{#{RUBY_PLATFORM}}
186
+ assert(yaml.platform?)
187
+ end
220
188
 
221
- assert_equal(MIME::Type.new('x-chemical/x-pdb').raw_media_type, 'x-chemical')
222
- assert_equal(@zip.raw_media_type, 'x-appl')
223
- end
189
+ def test_raw_media_type
190
+ assert_equal(MIME::Type.new('text/plain').raw_media_type, 'text')
191
+ assert_equal(MIME::Type.new('image/jpeg').raw_media_type, 'image')
192
+ assert_equal(MIME::Type.new('application/x-msword').raw_media_type, 'application')
193
+ assert_equal(MIME::Type.new('text/vCard').raw_media_type, 'text')
194
+ assert_equal(MIME::Type.new('application/pkcs7-mime').raw_media_type, 'application')
224
195
 
225
- def test_raw_sub_type
226
- assert_equal(MIME::Type.new('text/plain').raw_sub_type, 'plain')
227
- assert_equal(MIME::Type.new('image/jpeg').raw_sub_type, 'jpeg')
228
- assert_equal(MIME::Type.new('application/x-msword').raw_sub_type, 'x-msword')
229
- assert_equal(MIME::Type.new('text/vCard').raw_sub_type, 'vCard')
230
- assert_equal(MIME::Type.new('application/pkcs7-mime').raw_sub_type, 'pkcs7-mime')
231
- assert_equal(@zip.raw_sub_type, 'x-zip')
232
- end
196
+ assert_equal(MIME::Type.new('x-chemical/x-pdb').raw_media_type, 'x-chemical')
197
+ assert_equal(@zip.raw_media_type, 'x-appl')
198
+ end
233
199
 
234
- def test_registered_eh
235
- assert(MIME::Type.new('text/plain').registered?)
236
- assert(MIME::Type.new('image/jpeg').registered?)
237
- assert(!MIME::Type.new('application/x-msword').registered?)
238
- assert(MIME::Type.new('text/vCard').registered?)
239
- assert(MIME::Type.new('application/pkcs7-mime').registered?)
240
- assert(!@zip.registered?)
241
- end
200
+ def test_raw_sub_type
201
+ assert_equal(MIME::Type.new('text/plain').raw_sub_type, 'plain')
202
+ assert_equal(MIME::Type.new('image/jpeg').raw_sub_type, 'jpeg')
203
+ assert_equal(MIME::Type.new('application/x-msword').raw_sub_type, 'x-msword')
204
+ assert_equal(MIME::Type.new('text/vCard').raw_sub_type, 'vCard')
205
+ assert_equal(MIME::Type.new('application/pkcs7-mime').raw_sub_type, 'pkcs7-mime')
206
+ assert_equal(@zip.raw_sub_type, 'x-zip')
207
+ end
242
208
 
243
- def _test_registered_equals
244
- raise NotImplementedError, 'Need to write test_registered_equals'
245
- end
209
+ def test_registered_eh
210
+ assert(MIME::Type.new('text/plain').registered?)
211
+ assert(MIME::Type.new('image/jpeg').registered?)
212
+ refute(MIME::Type.new('application/x-msword').registered?)
213
+ assert(MIME::Type.new('text/vCard').registered?)
214
+ assert(MIME::Type.new('application/pkcs7-mime').registered?)
215
+ refute(@zip.registered?)
216
+ end
246
217
 
247
- def test_signature_eh
248
- assert(!MIME::Type.new('text/plain').signature?)
249
- assert(!MIME::Type.new('image/jpeg').signature?)
250
- assert(!MIME::Type.new('application/x-msword').signature?)
251
- assert(MIME::Type.new('text/vCard').signature?)
252
- assert(MIME::Type.new('application/pkcs7-mime').signature?)
253
- end
218
+ def _test_registered_equals
219
+ raise NotImplementedError, 'Need to write test_registered_equals'
220
+ end
254
221
 
255
- def test_simplified
256
- assert_equal(MIME::Type.new('text/plain').simplified, 'text/plain')
257
- assert_equal(MIME::Type.new('image/jpeg').simplified, 'image/jpeg')
258
- assert_equal(MIME::Type.new('application/x-msword').simplified, 'application/msword')
259
- assert_equal(MIME::Type.new('text/vCard').simplified, 'text/vcard')
260
- assert_equal(MIME::Type.new('application/pkcs7-mime').simplified, 'application/pkcs7-mime')
261
- assert_equal(MIME::Type.new('x-chemical/x-pdb').simplified, 'chemical/pdb')
262
- end
222
+ def test_signature_eh
223
+ refute(MIME::Type.new('text/plain').signature?)
224
+ refute(MIME::Type.new('image/jpeg').signature?)
225
+ refute(MIME::Type.new('application/x-msword').signature?)
226
+ assert(MIME::Type.new('text/vCard').signature?)
227
+ assert(MIME::Type.new('application/pkcs7-mime').signature?)
228
+ end
263
229
 
264
- def test_sub_type
265
- assert_equal(MIME::Type.new('text/plain').sub_type, 'plain')
266
- assert_equal(MIME::Type.new('image/jpeg').sub_type, 'jpeg')
267
- assert_equal(MIME::Type.new('application/x-msword').sub_type, 'msword')
268
- assert_equal(MIME::Type.new('text/vCard').sub_type, 'vcard')
269
- assert_equal(MIME::Type.new('application/pkcs7-mime').sub_type, 'pkcs7-mime')
270
- assert_equal(@zip.sub_type, 'zip')
271
- end
230
+ def test_simplified
231
+ assert_equal(MIME::Type.new('text/plain').simplified, 'text/plain')
232
+ assert_equal(MIME::Type.new('image/jpeg').simplified, 'image/jpeg')
233
+ assert_equal(MIME::Type.new('application/x-msword').simplified, 'application/msword')
234
+ assert_equal(MIME::Type.new('text/vCard').simplified, 'text/vcard')
235
+ assert_equal(MIME::Type.new('application/pkcs7-mime').simplified, 'application/pkcs7-mime')
236
+ assert_equal(MIME::Type.new('x-chemical/x-pdb').simplified, 'chemical/pdb')
237
+ end
272
238
 
273
- def test_system_equals
274
- assert_nothing_raised do
275
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit',
276
- 'linux')
277
- end
278
- assert_equal(@yaml.system, %r{linux})
279
- assert_nothing_raised { @yaml.system = /win32/ }
280
- assert_equal(@yaml.system, %r{win32})
281
- assert_nothing_raised { @yaml.system = nil }
282
- assert_nil(@yaml.system)
283
- end
239
+ def test_sub_type
240
+ assert_equal(MIME::Type.new('text/plain').sub_type, 'plain')
241
+ assert_equal(MIME::Type.new('image/jpeg').sub_type, 'jpeg')
242
+ assert_equal(MIME::Type.new('application/x-msword').sub_type, 'msword')
243
+ assert_equal(MIME::Type.new('text/vCard').sub_type, 'vcard')
244
+ assert_equal(MIME::Type.new('application/pkcs7-mime').sub_type, 'pkcs7-mime')
245
+ assert_equal(@zip.sub_type, 'zip')
246
+ end
284
247
 
285
- def test_system_eh
286
- assert_nothing_raised do
287
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit',
288
- 'linux')
289
- end
290
- assert(@yaml.system?)
291
- assert_nothing_raised { @yaml.system = nil }
292
- assert(!@yaml.system?)
293
- end
248
+ def test_system_equals
249
+ yaml = yaml_mime_type_from_array
250
+ assert_equal(yaml.system, %r{linux})
251
+ yaml.system = /win32/
252
+ assert_equal(yaml.system, %r{win32})
253
+ yaml.system = nil
254
+ assert_nil(yaml.system)
255
+ end
294
256
 
295
- def test_to_a
296
- assert_nothing_raised do
297
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit',
298
- 'linux')
299
- end
300
- assert_equal(@yaml.to_a, ['text/x-yaml', %w(yaml yml), '8bit',
301
- /linux/, nil, nil, nil, false])
302
- end
257
+ def test_system_eh
258
+ yaml = yaml_mime_type_from_array
259
+ assert(yaml.system?)
260
+ yaml.system = nil
261
+ refute(yaml.system?)
262
+ end
303
263
 
304
- def test_to_hash
305
- assert_nothing_raised do
306
- @yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit',
307
- 'linux')
308
- end
309
- assert_equal(@yaml.to_hash,
310
- { 'Content-Type' => 'text/x-yaml',
264
+ def test_to_a
265
+ yaml = yaml_mime_type_from_array
266
+ assert_equal(yaml.to_a, ['text/x-yaml', %w(yaml yml), '8bit',
267
+ /linux/, nil, nil, nil, false])
268
+ end
269
+
270
+ def test_to_hash
271
+ yaml = yaml_mime_type_from_array
272
+ assert_equal(yaml.to_hash,
273
+ { 'Content-Type' => 'text/x-yaml',
311
274
  'Content-Transfer-Encoding' => '8bit',
312
275
  'Extensions' => %w(yaml yml),
313
276
  'System' => /linux/,
@@ -315,42 +278,41 @@ module TestMIME
315
278
  'URL' => nil,
316
279
  'Obsolete' => nil,
317
280
  'Docs' => nil })
318
- end
281
+ end
319
282
 
320
- def test_to_s
321
- assert_equal("#{MIME::Type.new('text/plain')}", 'text/plain')
322
- end
283
+ def test_to_s
284
+ assert_equal("#{MIME::Type.new('text/plain')}", 'text/plain')
285
+ end
323
286
 
324
- def test_class_constructors
325
- assert_not_nil(@zip)
326
- yaml = MIME::Type.new('text/x-yaml') do |y|
327
- y.extensions = %w(yaml yml)
328
- y.encoding = '8bit'
329
- y.system = 'linux'
330
- end
331
- assert_instance_of(MIME::Type, yaml)
332
- assert_raises(MIME::InvalidContentType) { MIME::Type.new('apps') }
333
- assert_raises(MIME::InvalidContentType) { MIME::Type.new(nil) }
287
+ def test_class_constructors
288
+ refute_nil(@zip)
289
+ yaml = MIME::Type.new('text/x-yaml') do |y|
290
+ y.extensions = %w(yaml yml)
291
+ y.encoding = '8bit'
292
+ y.system = 'linux'
334
293
  end
294
+ assert_instance_of(MIME::Type, yaml)
295
+ assert_raises(MIME::InvalidContentType) { MIME::Type.new('apps') }
296
+ assert_raises(MIME::InvalidContentType) { MIME::Type.new(nil) }
297
+ end
335
298
 
336
- def _test_to_str
337
- raise NotImplementedError, 'Need to write test_to_str'
338
- end
299
+ def _test_to_str
300
+ raise NotImplementedError, 'Need to write test_to_str'
301
+ end
339
302
 
340
- def _test_url
341
- raise NotImplementedError, 'Need to write test_url'
342
- end
303
+ def _test_url
304
+ raise NotImplementedError, 'Need to write test_url'
305
+ end
343
306
 
344
- def _test_url_equals
345
- raise NotImplementedError, 'Need to write test_url_equals'
346
- end
307
+ def _test_url_equals
308
+ raise NotImplementedError, 'Need to write test_url_equals'
309
+ end
347
310
 
348
- def _test_urls
349
- raise NotImplementedError, 'Need to write test_urls'
350
- end
311
+ def _test_urls
312
+ raise NotImplementedError, 'Need to write test_urls'
313
+ end
351
314
 
352
- def __test_use_instead
353
- raise NotImplementedError, 'Need to write test_use_instead'
354
- end
315
+ def __test_use_instead
316
+ raise NotImplementedError, 'Need to write test_use_instead'
355
317
  end
356
318
  end