Skip to content
Snippets Groups Projects
Commit 62b6cd10 authored by Henry Cook's avatar Henry Cook
Browse files

Merging AlexRRR's test frameworks additions

parent 3f86eefa
No related branches found
No related tags found
No related merge requests found
source 'http://rubygems.org'
gem 'rake'
gem 'colorize'
gem 'puppet', '~> 3.7.1'
gem 'rspec', '~> 3.1'
gem 'puppet-lint', '~> 1.1.0'
gem 'rspec-puppet', '~> 1.0.1'
gem 'puppetlabs_spec_helper', '~> 0.8.2'
......@@ -17,3 +17,14 @@ To define a package, and all required dependencies, use this format:
r::package { 'reshape': dependencies => true, }
on RHEL/CentOS machines, make sure you have EPEL enabled, or R won't install properly.
## Testing
Testing is done via rspec-puppet, install dependencies
```
bundle install
```
run tests
```
rspec
```
# for rspec-puppet documentation - see http://rspec-puppet.com/tutorial/
require_relative '../spec_helper'
describe 'r::package' do
describe 'In ubuntu/redhat' do
let(:facts) { {
:operatingsystem => 'Debian',
:architecture => 'amd64',
:osfamily => 'Debian',
} }
let(:title) {'test'}
it 'sets up the correct binary' do
should contain_exec('install_r_package_test')
.with_unless(/\/usr\/bin\/R/)
end
end
end
../../../
\ No newline at end of file
dir = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift File.join(dir, 'lib')
require 'rspec-puppet'
require 'puppetlabs_spec_helper/module_spec_helper'
require 'puppetlabs_spec_helper/puppetlabs_spec_helper'
require 'yaml'
require 'mocha'
require 'puppet'
require 'rspec'
require 'spec/autorun'
fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
Spec::Runner.configure do |config|
config.mock_with :mocha
end
# We need this because the RAL uses 'should' as a method. This
# allows us the same behaviour but with a different method name.
class Object
alias :must :should
RSpec.configure do |c|
c.module_path = File.join(fixture_path, 'modules')
c.manifest_dir = File.join(fixture_path, 'manifests')
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment