Skip to content

Update for new gem version of puppetlabs_spec_helper #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source :rubygems

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.1.0'
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: ruby
rvm:
- 1.8.7
before_script:
after_script:
script: "rake spec_full"
branches:
only:
- master
env:
- PUPPET_VERSION=2.7.13
- PUPPET_VERSION=2.7.6
- PUPPET_VERSION=2.6.9
notifications:
email: false
gemfile: .gemfile
18 changes: 2 additions & 16 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
require 'rake'
require 'rspec/core/rake_task'

task :default => [:test]

desc 'Run RSpec'
RSpec::Core::RakeTask.new(:test) do |t|
t.pattern = 'spec/{unit}/**/*.rb'
t.rspec_opts = ['--color']
end

desc 'Generate code coverage'
RSpec::Core::RakeTask.new(:coverage) do |t|
t.rcov = true
t.rcov_opts = ['--exclude', 'spec']
end
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
53 changes: 0 additions & 53 deletions spec/lib/puppet_spec/files.rb

This file was deleted.

28 changes: 0 additions & 28 deletions spec/lib/puppet_spec/fixtures.rb

This file was deleted.

87 changes: 0 additions & 87 deletions spec/lib/puppet_spec/matchers.rb

This file was deleted.

9 changes: 0 additions & 9 deletions spec/lib/puppet_spec/verbose.rb

This file was deleted.

26 changes: 1 addition & 25 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
dir = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift File.join(dir, 'lib')

# Don't want puppet getting the command line arguments for rake or autotest
ARGV.clear

require 'puppet'
require 'facter'
require 'mocha'
gem 'rspec', '>=2.0.0'
require 'rspec/expectations'


# So everyone else doesn't have to include this base constant.
module PuppetSpec
FIXTURE_DIR = File.join(dir = File.expand_path(File.dirname(__FILE__)), "fixtures") unless defined?(FIXTURE_DIR)
end

# TODO: ultimately would like to move these requires into the puppet_spec_helper.rb file, but the namespaces
# are not currently the same between the two, so tests would need to be modified. Not ready to undertake that
# just yet.
require 'puppet_spec/files'

require 'puppet_spec_helper'

require 'puppetlabs_spec_helper/puppet_spec_helper'

RSpec.configure do |config|

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/puppet/parser/functions/get_module_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'fileutils'
require 'spec_helper'
describe Puppet::Parser::Functions.function(:get_module_path) do
include PuppetSpec::Files
include PuppetlabsSpec::Files

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