diff --git a/lib/resources/bond.rb b/lib/resources/bond.rb index 3dfb7d9bd..39a5e1ed0 100644 --- a/lib/resources/bond.rb +++ b/lib/resources/bond.rb @@ -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) diff --git a/lib/resources/service.rb b/lib/resources/service.rb index fa90d5853..04c1faed3 100644 --- a/lib/resources/service.rb +++ b/lib/resources/service.rb @@ -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" diff --git a/lib/resources/yum.rb b/lib/resources/yum.rb index 5f62a0967..85e49e783 100644 --- a/lib/resources/yum.rb +++ b/lib/resources/yum.rb @@ -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? diff --git a/test/resource/command.rb b/test/resource/command.rb index 5f719f458..9054df841 100644 --- a/test/resource/command.rb +++ b/test/resource/command.rb @@ -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 diff --git a/test/resource/ssh_config.rb b/test/resource/ssh_config.rb index 7caa24d4b..5212a4ef1 100644 --- a/test/resource/ssh_config.rb +++ b/test/resource/ssh_config.rb @@ -1,5 +1,5 @@ -return unless command('ssh').exists? +return unless command('ssh').exist? describe ssh_config do its('SendEnv') { should include('GORDON_CLIENT')} diff --git a/test/resource/sshd_config.rb b/test/resource/sshd_config.rb index 2304f3466..1ddbc6268 100644 --- a/test/resource/sshd_config.rb +++ b/test/resource/sshd_config.rb @@ -1,5 +1,5 @@ -return unless command('sshd').exists? +return unless command('sshd').exist? describe sshd_config do its('AcceptEnv') { should include('GORDON_SERVER')} diff --git a/test/runner/tests/path_block_device_test.rb b/test/runner/tests/path_block_device_test.rb index 2746bfbcb..18baceacd 100644 --- a/test/runner/tests/path_block_device_test.rb +++ b/test/runner/tests/path_block_device_test.rb @@ -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 diff --git a/test/runner/tests/path_character_device_test.rb b/test/runner/tests/path_character_device_test.rb index ac33d849b..decb4947e 100644 --- a/test/runner/tests/path_character_device_test.rb +++ b/test/runner/tests/path_character_device_test.rb @@ -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 diff --git a/test/runner/tests/path_file_test.rb b/test/runner/tests/path_file_test.rb index 8fdedd8b1..ee3ac92d1 100644 --- a/test/runner/tests/path_file_test.rb +++ b/test/runner/tests/path_file_test.rb @@ -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 diff --git a/test/runner/tests/path_folder_test.rb b/test/runner/tests/path_folder_test.rb index 203ee311e..c3bf4215d 100644 --- a/test/runner/tests/path_folder_test.rb +++ b/test/runner/tests/path_folder_test.rb @@ -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 diff --git a/test/runner/tests/path_missing_test.rb b/test/runner/tests/path_missing_test.rb index bd75cf74e..7bfe7c66e 100644 --- a/test/runner/tests/path_missing_test.rb +++ b/test/runner/tests/path_missing_test.rb @@ -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 diff --git a/test/runner/tests/path_pipe_test.rb b/test/runner/tests/path_pipe_test.rb index 910f94d51..044999651 100644 --- a/test/runner/tests/path_pipe_test.rb +++ b/test/runner/tests/path_pipe_test.rb @@ -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 diff --git a/test/runner/tests/path_symlink_test.rb b/test/runner/tests/path_symlink_test.rb index bdaf04536..3ce9a37da 100644 --- a/test/runner/tests/path_symlink_test.rb +++ b/test/runner/tests/path_symlink_test.rb @@ -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 diff --git a/test/unit/resource_bond_test.rb b/test/unit/resource_bond_test.rb index 4059fc480..043a6a494 100644 --- a/test/unit/resource_bond_test.rb +++ b/test/unit/resource_bond_test.rb @@ -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 diff --git a/test/unit/resource_yum_test.rb b/test/unit/resource_yum_test.rb index d278024bd..d4ea1ffd7 100644 --- a/test/unit/resource_yum_test.rb +++ b/test/unit/resource_yum_test.rb @@ -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