update function+test calls from exists? -> exist?

This commit is contained in:
Dominik Richter 2015-09-18 12:44:29 +02:00
parent 366bc44d0d
commit bb18ce52e2
15 changed files with 24 additions and 24 deletions

View file

@ -21,7 +21,7 @@ module Vulcano::Resources
@file.content,
assignment_re: /^\s*([^:]*?)\s*:\s*(.*?)\s*$/,
multiple_values: true,
).params if @file.exists?
).params if @file.exist?
@loaded = true
@content
end
@ -37,8 +37,8 @@ module Vulcano::Resources
@content
end
def exists?
@file.exists?
def exist?
@file.exist?
end
def has_interface?(interface)

View file

@ -173,7 +173,7 @@ class SysV < ServiceManager
service = @vulcano.file(filename)
# check if service is installed
return nil if !service.exists?
return nil if !service.exist?
# check if service is enabled
configfile = "/etc/init/#{service_name}.conf"

View file

@ -117,7 +117,7 @@ class YumRepo
@cache
end
def exists?
def exist?
!info.nil?
end
@ -141,7 +141,7 @@ module Vulcano::Resources
def exists?
deprecated
@repository.exists?
@repository.exist?
end
def enabled?

View file

@ -17,14 +17,14 @@ describe command('exit 123') do
its(:exit_status) { should eq 123 }
end
describe command('/bin/sh').exists? do
describe command('/bin/sh').exist? do
it { should eq true }
end
describe command('sh').exists? do
describe command('sh').exist? do
it { should eq true }
end
describe command('this is not existing').exists? do
describe command('this is not existing').exist? do
it { should eq false }
end

View file

@ -1,5 +1,5 @@
return unless command('ssh').exists?
return unless command('ssh').exist?
describe ssh_config do
its('SendEnv') { should include('GORDON_CLIENT')}

View file

@ -1,5 +1,5 @@
return unless command('sshd').exists?
return unless command('sshd').exist?
describe sshd_config do
its('AcceptEnv') { should include('GORDON_SERVER')}

View file

@ -7,7 +7,7 @@ describe 'file interface' do
let(:file) { backend.file('/tmp/block_device') }
it 'exists' do
file.exists?.must_equal(true)
file.exist?.must_equal(true)
end
it 'is a block device' do

View file

@ -7,7 +7,7 @@ describe 'file interface' do
let(:file) { backend.file('/dev/null') }
it 'exists' do
file.exists?.must_equal(true)
file.exist?.must_equal(true)
end
it 'is a character device' do

View file

@ -7,7 +7,7 @@ describe 'file interface' do
let(:file) { backend.file('/tmp/file') }
it 'exists' do
file.exists?.must_equal(true)
file.exist?.must_equal(true)
end
it 'is a file' do

View file

@ -7,7 +7,7 @@ describe 'file interface' do
let(:file) { backend.file('/tmp/folder') }
it 'exists' do
file.exists?.must_equal(true)
file.exist?.must_equal(true)
end
it 'is a directory' do

View file

@ -9,7 +9,7 @@ describe 'file interface' do
}
it 'does not exist' do
file.exists?.must_equal(false)
file.exist?.must_equal(false)
end
it 'is not a file' do

View file

@ -7,7 +7,7 @@ describe 'file interface' do
let(:file) { backend.file('/tmp/pipe') }
it 'exists' do
file.exists?.must_equal(true)
file.exist?.must_equal(true)
end
it 'is a pipe' do

View file

@ -7,7 +7,7 @@ describe 'file interface' do
let(:file) { backend.file('/tmp/symlink') }
it 'exists' do
file.exists?.must_equal(true)
file.exist?.must_equal(true)
end
it 'is a symlink' do

View file

@ -10,7 +10,7 @@ describe 'Vulcano::Resources::Bond' do
let(:resource) { loadResource('bond', 'bond0') }
it 'bond must be available' do
resource.exists?.must_equal true
resource.exist?.must_equal true
end
it 'eth0 is part of bond' do

View file

@ -50,32 +50,32 @@ describe 'Vulcano::Resources::YumRepo' do
# its('epel') { should exist }
# its('epel') { should be_enabled }
it 'test its syntax repo' do
_(resource.extras.exists?).must_equal true
_(resource.extras.exist?).must_equal true
_(resource.extras.enabled?).must_equal true
end
it 'test enabled extra repo' do
extras = resource.repo('extras/7/x86_64')
_(extras.exists?).must_equal true
_(extras.exist?).must_equal true
_(extras.enabled?).must_equal true
end
it 'test enabled extra repo with short name' do
extras = resource.repo('extras')
_(extras.exists?).must_equal true
_(extras.exist?).must_equal true
_(extras.enabled?).must_equal true
end
it 'test disabled extra-source repo' do
extras = resource.repo('base-debuginfo/x86_64')
_(extras.exists?).must_equal true
_(extras.exist?).must_equal true
_(extras.enabled?).must_equal false
end
# test serverspec syntax
let(:serverspec) { loadResource('yumrepo', 'extras') }
it 'test enabled extra repo' do
_(serverspec.exists?).must_equal true
_(serverspec.exist?).must_equal true
_(serverspec.enabled?).must_equal true
end
end