Sha256: 13a8e58ecc710ce3684be10dd5bd72c13bb6354c21d97c5880f8a2fa703110c6
Contents?: true
Size: 973 Bytes
Versions: 18
Compression:
Stored size: 973 Bytes
Contents
require 'spec_helper' describe Chef::Sugar::Docker do it_behaves_like 'a chef sugar' before(:each) do allow(File).to receive(:exist?) .with("/.dockerenv") .and_return(false) allow(File).to receive(:exist?) .with("/.dockerinit") .and_return(false) end describe '#docker?' do it 'is true when the file /.dockerenv is present' do allow(File).to receive(:exist?) .with("/.dockerenv") .and_return(true) node = { 'docker' => nil } expect(described_class.docker?(node)).to be true end it 'is true when the file /.dockerinit is present' do allow(File).to receive(:exist?) .with("/.dockerinit") .and_return(true) node = { 'docker' => nil } expect(described_class.docker?(node)).to be true end it 'is false when the node is not on cloud' do node = { 'docker' => nil } expect(described_class.docker?(node)).to be false end end end
Version data entries
18 entries across 18 versions & 2 rubygems