Skip to content

Commit 038c575

Browse files
committed
(GH-819) Fix acceptance and unit tests
1 parent 0e8d058 commit 038c575

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

Diff for: spec/classes/init_spec.rb

-6
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,6 @@
196196
}
197197
else
198198
it {
199-
# Stub /tmp_docker dir to prevent shelling out during spec test
200-
allow(Dir).to receive(:exist?).and_wrap_original do |original_method, a|
201-
original_method.call(a)
202-
end
203-
allow(Dir).to receive(:exist?).with('/tmp_docker').and_return(true)
204-
205199
is_expected.to contain_class('docker::repos').that_comes_before('Class[docker::install]')
206200
is_expected.to contain_class('docker::install').that_comes_before('Class[docker::config]')
207201
is_expected.to contain_class('docker::config').that_comes_before('Class[docker::service]')

Diff for: spec/defines/registry_spec.rb

-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
require 'spec_helper'
44

5-
# Stub /tmp_docker dir to prevent shelling out during spec test
6-
class Dir
7-
class << self
8-
def exist?(var)
9-
return true if var == '/tmp_docker'
10-
end
11-
end
12-
end
13-
145
tests = {
156
'with ensure => absent' => {
167
'ensure' => 'absent',

Diff for: spec/unit/lib/puppet/type/docker_compose_spec.rb

+6-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
require 'spec_helper'
44

5-
# Stub /tmp_docker dir to prevent shelling out during spec test
6-
class Dir
7-
class << self
8-
def exist?(var)
9-
return true if var == '/tmp_docker'
10-
end
11-
end
12-
end
13-
145
compose = Puppet::Type.type(:docker_compose)
156

167
describe compose do
@@ -27,6 +18,7 @@ def exist?(var)
2718
let :properties do
2819
[
2920
:ensure,
21+
:tmpdir
3022
]
3123
end
3224

@@ -53,4 +45,9 @@ def exist?(var)
5345
it 'requires scale to be a hash' do
5446
expect(compose).to require_hash_for('scale')
5547
end
48+
49+
it 'requires tmpdir to be a string' do
50+
expect(compose).to require_string_for('tmpdir')
51+
end
52+
5653
end

0 commit comments

Comments
 (0)