Sha256: fedeccb5cdb4bdc8513ba3bb4124218b1a69ccfab7a945587f06587bb3030b78

Contents?: true

Size: 691 Bytes

Versions: 5

Compression:

Stored size: 691 Bytes

Contents

# frozen_string_literal: true

require '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 @tester.extension.match(/(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)/)
  end

  def test_mime_type_format
    assert @tester.mime_type.match(%r{(.*)/(.*)+})
  end

  def test_file_name
    assert @tester.file_name.match(%r{([a-z\-_]+)(\\|/)([a-z\-_]+)\.([a-z]+)})
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ffaker-2.16.0 test/test_filesystem.rb
ffaker-2.15.0 test/test_filesystem.rb
ffaker-2.14.0 test/test_filesystem.rb
ffaker-2.13.0 test/test_filesystem.rb
ffaker-2.12.0 test/test_filesystem.rb