Skip to content

Commit

Permalink
(GH-819) Fix acceptance and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chelnak committed Apr 12, 2022
1 parent 0e8d058 commit bf47696
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
6 changes: 0 additions & 6 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,6 @@
}
else
it {
# Stub /tmp_docker dir to prevent shelling out during spec test
allow(Dir).to receive(:exist?).and_wrap_original do |original_method, a|
original_method.call(a)
end
allow(Dir).to receive(:exist?).with('/tmp_docker').and_return(true)

is_expected.to contain_class('docker::repos').that_comes_before('Class[docker::install]')
is_expected.to contain_class('docker::install').that_comes_before('Class[docker::config]')
is_expected.to contain_class('docker::config').that_comes_before('Class[docker::service]')
Expand Down
9 changes: 0 additions & 9 deletions spec/defines/registry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

require 'spec_helper'

# Stub /tmp_docker dir to prevent shelling out during spec test
class Dir
class << self
def exist?(var)
return true if var == '/tmp_docker'
end
end
end

tests = {
'with ensure => absent' => {
'ensure' => 'absent',
Expand Down
15 changes: 6 additions & 9 deletions spec/unit/lib/puppet/type/docker_compose_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

require 'spec_helper'

# Stub /tmp_docker dir to prevent shelling out during spec test
class Dir
class << self
def exist?(var)
return true if var == '/tmp_docker'
end
end
end

compose = Puppet::Type.type(:docker_compose)

describe compose do
Expand All @@ -27,6 +18,7 @@ def exist?(var)
let :properties do
[
:ensure,
:tmpdir
]
end

Expand All @@ -53,4 +45,9 @@ def exist?(var)
it 'requires scale to be a hash' do
expect(compose).to require_hash_for('scale')
end

it 'requires tmpdir to be a string' do
expect(compose).to require_string_for('tmdir')
end

end

0 comments on commit bf47696

Please sign in to comment.