Skip to content

Commit 29f8f89

Browse files
committed
Merge pull request puppetlabs#73 from branan/use_spechelper_gem
Update for new gem version of puppetlabs_spec_helper
2 parents e299ac6 + d9410f7 commit 29f8f89

File tree

9 files changed

+26
-220
lines changed

9 files changed

+26
-220
lines changed

.gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
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'

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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

Rakefile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,2 @@
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'

spec/lib/puppet_spec/files.rb

Lines changed: 0 additions & 53 deletions
This file was deleted.

spec/lib/puppet_spec/fixtures.rb

Lines changed: 0 additions & 28 deletions
This file was deleted.

spec/lib/puppet_spec/matchers.rb

Lines changed: 0 additions & 87 deletions
This file was deleted.

spec/lib/puppet_spec/verbose.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

spec/spec_helper.rb

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,4 @@
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'
262

273
RSpec.configure do |config|
284

spec/unit/puppet/parser/functions/get_module_path_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'fileutils'
44
require 'spec_helper'
55
describe Puppet::Parser::Functions.function(:get_module_path) do
6-
include PuppetSpec::Files
6+
include PuppetlabsSpec::Files
77

88
def get_scope(environment = 'production')
99
scope = Puppet::Parser::Scope.new
@@ -30,7 +30,7 @@ def get_scope(environment = 'production')
3030
get_scope.function_get_module_path(['foo']).should == foo_path
3131
end
3232
it 'should be able to find module paths from the environment' do
33-
conf_file = tmpfile('conffile')
33+
conf_file = tmpfilename('conffile')
3434
File.open(conf_file, 'w') do |fh|
3535
fh.write("[dansenvironment]\nmodulepath = #{modulepath}")
3636
end

0 commit comments

Comments
 (0)