Merge pull request #161 from hunner/fix_lets

Lets can't be used outside of a test context
This commit is contained in:
Hunter Haugen 2014-02-27 15:50:42 -08:00
commit 6c50f50aa0
9 changed files with 10 additions and 30 deletions

View file

@ -1,9 +1,7 @@
require 'spec_helper_acceptance' require 'spec_helper_acceptance'
describe 'concat backup parameter' do describe 'concat backup parameter' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
context '=> puppet' do context '=> puppet' do
before :all do before :all do
shell("rm -rf #{basedir}") shell("rm -rf #{basedir}")

View file

@ -13,9 +13,7 @@ else
end end
describe 'basic concat test' do describe 'basic concat test' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
shared_examples 'successfully_applied' do |pp| shared_examples 'successfully_applied' do |pp|
it 'applies the manifest twice with no stderr' do it 'applies the manifest twice with no stderr' do

View file

@ -1,9 +1,7 @@
require 'spec_helper_acceptance' require 'spec_helper_acceptance'
describe 'concat force empty parameter' do describe 'concat force empty parameter' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
context 'should run successfully' do context 'should run successfully' do
pp = <<-EOS pp = <<-EOS
include concat::setup include concat::setup

View file

@ -13,9 +13,7 @@ else
end end
describe 'concat::fragment source' do describe 'concat::fragment source' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
context 'should read file fragments from local system' do context 'should read file fragments from local system' do
before(:all) do before(:all) do
shell("/bin/echo 'file1 contents' > #{basedir}/file1") shell("/bin/echo 'file1 contents' > #{basedir}/file1")

View file

@ -1,9 +1,7 @@
require 'spec_helper_acceptance' require 'spec_helper_acceptance'
describe 'concat ensure_newline parameter' do describe 'concat ensure_newline parameter' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
context '=> false' do context '=> false' do
pp = <<-EOS pp = <<-EOS
include concat::setup include concat::setup

View file

@ -1,9 +1,7 @@
require 'spec_helper_acceptance' require 'spec_helper_acceptance'
describe 'concat order' do describe 'concat order' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
before(:all) do before(:all) do
shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat") shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat")
shell("mkdir -p #{basedir}") shell("mkdir -p #{basedir}")
@ -79,9 +77,7 @@ describe 'concat order' do
end # concat order end # concat order
describe 'concat::fragment order' do describe 'concat::fragment order' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
before(:all) do before(:all) do
shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat") shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat")
shell("mkdir -p #{basedir}") shell("mkdir -p #{basedir}")

View file

@ -1,9 +1,7 @@
require 'spec_helper_acceptance' require 'spec_helper_acceptance'
describe 'replacement of' do describe 'replacement of' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
context 'file' do context 'file' do
context 'should not succeed' do context 'should not succeed' do
before(:all) do before(:all) do

View file

@ -1,9 +1,7 @@
require 'spec_helper_acceptance' require 'spec_helper_acceptance'
describe 'symbolic name' do describe 'symbolic name' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
pp = <<-EOS pp = <<-EOS
include concat::setup include concat::setup
concat { 'not_abs_path': concat { 'not_abs_path':

View file

@ -1,9 +1,7 @@
require 'spec_helper_acceptance' require 'spec_helper_acceptance'
describe 'concat warn =>' do describe 'concat warn =>' do
let :basedir do basedir = default.tmpdir('concat')
default.tmpdir('concat')
end
context 'true should enable default warning message' do context 'true should enable default warning message' do
pp = <<-EOS pp = <<-EOS
include concat::setup include concat::setup