Add unit test of Swift::MountDevice type
Change-Id: I4486bf134e068b95c1ec71848efabd24069b186b
This commit is contained in:
parent
b35d4af619
commit
9ac945a2cb
33
spec/type_aliases/mountdevice_spec.rb
Normal file
33
spec/type_aliases/mountdevice_spec.rb
Normal file
@ -0,0 +1,33 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'Swift::MountDevice' do
|
||||
describe 'valid types' do
|
||||
context 'with valid types' do
|
||||
[
|
||||
'/dev',
|
||||
'/dev/sda',
|
||||
'/opt/swift/diskfile',
|
||||
'LABEL=foo'
|
||||
].each do |value|
|
||||
it { is_expected.to allow_value(value) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'invalid types' do
|
||||
context 'with invalid types' do
|
||||
[
|
||||
1,
|
||||
true,
|
||||
{},
|
||||
['/dev/sda'],
|
||||
'dev',
|
||||
'dev/sda',
|
||||
'LABEL=',
|
||||
'LABELfoo'
|
||||
].each do |value|
|
||||
it { is_expected.not_to allow_value(value) }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user