1
0
mirror of https://github.com/meineerde/rackstash.git synced 2026-02-11 13:05:19 +00:00

Test that Adapter::File.from_uri only accepts file URIs

This commit is contained in:
Holger Just 2018-01-25 10:56:43 +01:00
parent 6d4106fcb7
commit 18abd892ba

View File

@ -41,6 +41,14 @@ describe Rackstash::Adapter::File do
expect(described_class.from_uri('file:/tmp/file_spec.log?auto_reopen=false').auto_reopen?) expect(described_class.from_uri('file:/tmp/file_spec.log?auto_reopen=false').auto_reopen?)
.to eql false .to eql false
end end
it 'only accepts file URIs' do
expect { described_class.from_uri('http://example.com') }
.to raise_error ArgumentError, 'Invalid URI: http://example.com'
expect { described_class.from_uri('') }
.to raise_error ArgumentError, 'Invalid URI: '
end
end end
describe '#initialize' do describe '#initialize' do