File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ require 'spec_helper'
2+
3+ describe 'python::virtualenv' , type : :define do
4+ on_supported_os . each do |os , facts |
5+ next if os == 'gentoo-3-x86_64'
6+ context "on #{ os } " do
7+ let :facts do
8+ facts
9+ end
10+ let :title do
11+ '/opt/env'
12+ end
13+
14+ context 'with default parameters' do
15+ it { is_expected . to compile . with_all_deps }
16+ it { is_expected . to contain_file ( '/opt/env' ) }
17+ it { is_expected . to contain_exec ( 'python_virtualenv_/opt/env' ) . with_command ( 'virtualenv --no-site-packages -p python /opt/env && /opt/env/bin/pip --log /opt/env/pip.log install --proxy= --upgrade pip && /opt/env/bin/pip install --proxy= --upgrade distribute' ) }
18+ end
19+
20+ context 'when virtualenv is defined' do
21+ let ( :params ) { { virtualenv : 'virtualenv-3' } }
22+
23+ it { is_expected . to compile . with_all_deps }
24+ it { is_expected . to contain_exec ( 'python_virtualenv_/opt/env' ) . with_command ( %r{virtualenv-3 --no-site-packages -p python .+} ) }
25+ end
26+
27+ describe 'when ensure' do
28+ context 'is absent' do
29+ let :params do
30+ {
31+ ensure : 'absent'
32+ }
33+ end
34+
35+ it {
36+ is_expected . to contain_file ( '/opt/env' ) . with_ensure ( 'absent' ) . with_purge ( true )
37+ }
38+ end
39+ end
40+ end # context
41+ end
42+ end
You can’t perform that action at this time.
0 commit comments