]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/staging/spec/defines/staging_deploy_spec.rb
add nanliu/staging to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / staging / spec / defines / staging_deploy_spec.rb
1 require 'spec_helper'
2 describe 'staging::deploy', :type => :define do
3
4   # forcing a more sane caller_module_name to match real usage.
5   let(:facts) { { :caller_module_name => 'spec',
6                   :osfamily           => 'RedHat',
7                   :staging_http_get   => 'curl',
8                   :path               => '/usr/local/bin:/usr/bin:/bin', } }
9
10   describe 'when deploying tar.gz' do
11     let(:title) { 'sample.tar.gz' }
12     let(:params) { { :source => 'puppet:///modules/staging/sample.tar.gz',
13       :target => '/usr/local' } }
14
15     it {
16       should contain_file('/opt/staging')
17       should contain_file('/opt/staging/spec/sample.tar.gz')
18       should contain_exec('extract sample.tar.gz').with({
19         :command => 'tar xzf /opt/staging/spec/sample.tar.gz',
20         :path    => '/usr/local/bin:/usr/bin:/bin',
21         :cwd     => '/usr/local',
22         :creates => '/usr/local/sample'
23       })
24     }
25   end
26
27 end