summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2018-08-12 01:45:03 -0400
committerAustin Ziegler <austin@zieglers.ca>2018-08-12 02:30:03 -0400
commitd5d7c57609d90c2113f4d52d29b7218b42236dcb (patch)
treec7a15d9d54b581f63db12b525dacc747524dd9da /test
parentca89015739efe42e12c279823190dba9bcaaf6b6 (diff)
downloadmime-types-d5d7c57609d90c2113f4d52d29b7218b42236dcb.tar.gz
Perform some maintenance for v3.2
Diffstat (limited to 'test')
-rw-r--r--test/test_mime_types_cache.rb6
-rw-r--r--test/test_mime_types_lazy.rb12
2 files changed, 12 insertions, 6 deletions
diff --git a/test/test_mime_types_cache.rb b/test/test_mime_types_cache.rb
index 7bbb894..d8cfb3a 100644
--- a/test/test_mime_types_cache.rb
+++ b/test/test_mime_types_cache.rb
@@ -37,11 +37,11 @@ describe MIME::Types::Cache do
describe '.load' do
it 'does not use cache when RUBY_MIME_TYPES_CACHE is unset' do
ENV.delete('RUBY_MIME_TYPES_CACHE')
- assert_equal(nil, MIME::Types::Cache.load)
+ assert_nil MIME::Types::Cache.load
end
it 'does not use cache when missing' do
- assert_equal(nil, MIME::Types::Cache.load)
+ assert_nil MIME::Types::Cache.load
end
it 'registers the data to be updated by #add_extensions' do
@@ -80,7 +80,7 @@ describe MIME::Types::Cache do
describe '.save' do
it 'does not create cache when RUBY_MIME_TYPES_CACHE is unset' do
ENV.delete('RUBY_MIME_TYPES_CACHE')
- assert_equal(nil, MIME::Types::Cache.save)
+ assert_nil MIME::Types::Cache.save
end
it 'creates the cache ' do
diff --git a/test/test_mime_types_lazy.rb b/test/test_mime_types_lazy.rb
index 75e8dc7..e730ba1 100644
--- a/test/test_mime_types_lazy.rb
+++ b/test/test_mime_types_lazy.rb
@@ -22,17 +22,23 @@ describe MIME::Types, 'lazy loading' do
describe '.lazy_load?' do
it 'is true when RUBY_MIME_TYPES_LAZY_LOAD is set' do
- assert_equal true, MIME::Types.send(:lazy_load?)
+ assert_output '', /RUBY_MIME_TYPES_LAZY_LOAD/ do
+ assert_equal true, MIME::Types.send(:lazy_load?)
+ end
end
it 'is nil when RUBY_MIME_TYPES_LAZY_LOAD is unset' do
ENV['RUBY_MIME_TYPES_LAZY_LOAD'] = nil
- assert_equal nil, MIME::Types.send(:lazy_load?)
+ assert_output '', '' do
+ assert_nil MIME::Types.send(:lazy_load?)
+ end
end
it 'is false when RUBY_MIME_TYPES_LAZY_LOAD is false' do
ENV['RUBY_MIME_TYPES_LAZY_LOAD'] = 'false'
- assert_equal false, MIME::Types.send(:lazy_load?)
+ assert_output '', /RUBY_MIME_TYPES_LAZY_LOAD/ do
+ assert_equal false, MIME::Types.send(:lazy_load?)
+ end
end
end