diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-21 13:45:27 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-21 13:45:27 -0700 |
commit | f9dda1567ea8d5b27bd9d66ac5a8b43dc67a6b7e (patch) | |
tree | fb5bfd624e1b482248785eb14a253730d8c3ea57 /actionpack/test | |
parent | 8325d4c4737aa26692a0693b1289932e78e617af (diff) | |
download | rails-f9dda1567ea8d5b27bd9d66ac5a8b43dc67a6b7e.tar.gz rails-f9dda1567ea8d5b27bd9d66ac5a8b43dc67a6b7e.tar.bz2 rails-f9dda1567ea8d5b27bd9d66ac5a8b43dc67a6b7e.zip |
change inheritance to composition
Changes `Mimes` to compose a set rather than inherit from array. With
this change we don't need to define as many methods, so ISEQ memory is
saved. Also it is clear which methods break the set cache.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/mime_type_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 32e3bded55..520864b7d9 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -95,8 +95,9 @@ class MimeTypeTest < ActiveSupport::TestCase test "custom type" do begin - Mime::Type.register("image/foo", :foo) - assert_equal Mime::Type[:FOO], Mime::SET.last + type = Mime::Type.register("image/foo", :foo) + assert_equal Mime::Type[:FOO], type + assert Mime::Type.registered?(:FOO) ensure Mime::Type.unregister(:FOO) end |