Sha256: 2176722e4a0debbc560f4a2ef5dfe735e89480510f30e893dc9a0e95cd313fd9
Contents?: true
Size: 678 Bytes
Versions: 13
Compression:
Stored size: 678 Bytes
Contents
require 'spec_helper' describe Hydra::PCDM::GetMimeTypeForFile do context 'with faulty input' do let(:error_message) { 'supplied argument should be a path to a file' } it 'raises and error' do expect(-> { described_class.call(['bad input']) }).to raise_error(ArgumentError, error_message) end end context 'with a standard file type' do let(:path) { '/path/file.jpg' } subject { described_class.call(path) } it { is_expected.to eql 'image/jpeg' } end context 'with an unknown file type' do let(:path) { '/path/file.jkl' } subject { described_class.call(path) } it { is_expected.to eql 'application/octet-stream' } end end
Version data entries
13 entries across 13 versions & 1 rubygems