Sha256: 54fcd11cf83b3cb02d7fda462e882bd4d761b646c7edc1d24b6f9edacd226b91
Contents?: true
Size: 874 Bytes
Versions: 3
Compression:
Stored size: 874 Bytes
Contents
# frozen_string_literal: true require_relative 'helper' class TestFakerFilesystem < Test::Unit::TestCase include DeterministicHelper assert_methods_are_deterministic( FFaker::Filesystem, :extension, :mime_type, :file_name ) def setup @tester = FFaker::Filesystem end def test_extension assert_match /\A(?:flac|mp3|wav|bmp|gif|jpeg|jpg|png|tiff|css|csv|html|js| json|txt|mp4|avi|mov|webm|doc|docx|xls|xlsx|ppt|pptx|odt| ods|odp|pages|numbers|key|pdf)\z/x, @tester.extension end def test_mime_type_format assert_match %r{\A\w+/.+\z}, @tester.mime_type end def test_directory assert_match %r{\A(?:[a-z_-]+[\\/])+[a-z_-]+\z}, @tester.directory end def test_file_name assert_match %r{\A(?:[a-z_-]+[\\/])+[a-z_-]+\.\w{2,4}\z}, @tester.file_name end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ffaker-2.21.0 | test/test_filesystem.rb |
ffaker-2.20.0 | test/test_filesystem.rb |
ffaker-2.19.0 | test/test_filesystem.rb |