Add unit test of Swift::MountDevice type

Change-Id: I4486bf134e068b95c1ec71848efabd24069b186b
(cherry picked from commit 9ac945a2cb)
This commit is contained in:
Takashi Kajinami 2024-05-02 00:47:39 +09:00
parent 642bd4006c
commit d12c37d1b9

View 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