File tree Expand file tree Collapse file tree 9 files changed +26
-220
lines changed
unit/puppet/parser/functions Expand file tree Collapse file tree 9 files changed +26
-220
lines changed Original file line number Diff line number Diff line change
1
+ source :rubygems
2
+
3
+ puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
4
+ gem 'puppet', puppetversion
5
+ gem 'puppetlabs_spec_helper', '>= 0.1.0'
Original file line number Diff line number Diff line change
1
+ language : ruby
2
+ rvm :
3
+ - 1.8.7
4
+ before_script :
5
+ after_script :
6
+ script : " rake spec_full"
7
+ branches :
8
+ only :
9
+ - master
10
+ env :
11
+ - PUPPET_VERSION=2.7.13
12
+ - PUPPET_VERSION=2.7.6
13
+ - PUPPET_VERSION=2.6.9
14
+ notifications :
15
+ email : false
16
+ gemfile : .gemfile
Original file line number Diff line number Diff line change 1
- require 'rake'
2
- require 'rspec/core/rake_task'
3
-
4
- task :default => [ :test ]
5
-
6
- desc 'Run RSpec'
7
- RSpec ::Core ::RakeTask . new ( :test ) do |t |
8
- t . pattern = 'spec/{unit}/**/*.rb'
9
- t . rspec_opts = [ '--color' ]
10
- end
11
-
12
- desc 'Generate code coverage'
13
- RSpec ::Core ::RakeTask . new ( :coverage ) do |t |
14
- t . rcov = true
15
- t . rcov_opts = [ '--exclude' , 'spec' ]
16
- end
1
+ require 'rubygems'
2
+ require 'puppetlabs_spec_helper/rake_tasks'
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- dir = File . expand_path ( File . dirname ( __FILE__ ) )
2
- $LOAD_PATH. unshift File . join ( dir , 'lib' )
3
-
4
- # Don't want puppet getting the command line arguments for rake or autotest
5
- ARGV . clear
6
-
7
- require 'puppet'
8
- require 'facter'
9
- require 'mocha'
10
- gem 'rspec' , '>=2.0.0'
11
- require 'rspec/expectations'
12
-
13
-
14
- # So everyone else doesn't have to include this base constant.
15
- module PuppetSpec
16
- FIXTURE_DIR = File . join ( dir = File . expand_path ( File . dirname ( __FILE__ ) ) , "fixtures" ) unless defined? ( FIXTURE_DIR )
17
- end
18
-
19
- # TODO: ultimately would like to move these requires into the puppet_spec_helper.rb file, but the namespaces
20
- # are not currently the same between the two, so tests would need to be modified. Not ready to undertake that
21
- # just yet.
22
- require 'puppet_spec/files'
23
-
24
- require 'puppet_spec_helper'
25
-
1
+ require 'puppetlabs_spec_helper/puppet_spec_helper'
26
2
27
3
RSpec . configure do |config |
28
4
Original file line number Diff line number Diff line change 3
3
require 'fileutils'
4
4
require 'spec_helper'
5
5
describe Puppet ::Parser ::Functions . function ( :get_module_path ) do
6
- include PuppetSpec ::Files
6
+ include PuppetlabsSpec ::Files
7
7
8
8
def get_scope ( environment = 'production' )
9
9
scope = Puppet ::Parser ::Scope . new
@@ -30,7 +30,7 @@ def get_scope(environment = 'production')
30
30
get_scope . function_get_module_path ( [ 'foo' ] ) . should == foo_path
31
31
end
32
32
it 'should be able to find module paths from the environment' do
33
- conf_file = tmpfile ( 'conffile' )
33
+ conf_file = tmpfilename ( 'conffile' )
34
34
File . open ( conf_file , 'w' ) do |fh |
35
35
fh . write ( "[dansenvironment]\n modulepath = #{ modulepath } " )
36
36
end
You can’t perform that action at this time.
0 commit comments