-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
erroneously changed in a990c0b and add tests to ensure this kind of breakage will not repeat
- Loading branch information
Greg Dubicki
committed
Nov 4, 2018
1 parent
13b725d
commit 5dd598e
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require 'spec_helper' | ||
|
||
describe 'python::dotfile', type: :define do | ||
on_supported_os.each do |os, facts| | ||
context("on #{os} ") do | ||
let :facts do | ||
facts | ||
end | ||
|
||
describe 'dotfile as' do | ||
context 'fails with empty string filename' do | ||
let(:title) { '' } | ||
|
||
it { is_expected.to raise_error(%r{Evaluation Error: Empty string title at 0. Title strings must have a length greater than zero.}) } | ||
end | ||
context 'fails with incorrect mode' do | ||
let(:title) { '/etc/pip.conf' } | ||
let(:params) { { mode: 'not-a-mode' } } | ||
|
||
it { is_expected.to raise_error(%r{Evaluation Error: Error while evaluating a Resource}) } | ||
end | ||
context 'succeeds with filename in existing path' do | ||
let(:title) { '/etc/pip.conf' } | ||
|
||
it { is_expected.to contain_file('/etc/pip.conf').with_mode('0644') } | ||
end | ||
context 'succeeds with filename in a non-existing path' do | ||
let(:title) { '/home/someuser/.pip/pip.conf' } | ||
|
||
it { is_expected.to contain_exec('create /home/someuser/.pip/pip.conf\'s parent dir').with_command('install -o root -g root -d /home/someuser/.pip') } | ||
it { is_expected.to contain_file('/home/someuser/.pip/pip.conf').with_mode('0644') } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters