Permalink
Browse files

linting and a spec

  • Loading branch information...
1 parent db27f05 commit 613d5b066b10151e34eba1f232b898abe1850d10 @haf haf committed Sep 1, 2012
View
@@ -5,7 +5,8 @@ guard 'rake', :task => 'lint' do
watch(%r{^.+\.pp$})
end
-guard 'rspec', :version => 2, :spec_paths => ['spec/*/*_spec.rb'], :cli => '--color' do
+# ['spec/*/*_spec.rb']
+guard 'rspec', :version => 2, :spec_paths => 'spec/functions/', :cli => '--color' do
watch(%r{^spec\/.+_spec\.rb$})
watch(%r{^spec\/shared_contexts\.rb$})
watch(%r{^manifests\/(.+)\.pp$}) {
View
@@ -6,16 +6,11 @@ require 'fileutils'
Vagrant::Config.run do |config|
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
-
#config.vm.box = 'debian-6.0'
#config.vm.box_url = 'http://puppetlabs.s3.amazonaws.com/pub/Squeeze64.box'
-
#config.vm.box = 'centos-6.0'
#config.vm.box_url = 'http://dl.dropbox.com/u/9227672/CentOS-6.0-x86_64-netboot-4.1.6.box'
- # config.vm.forward_port 80, 8080
- # config.vm.share_folder 'files-puppet', '/etc/puppet/files', 'files'
-
config.vm.share_folder 'riak-module', "#{FileUtils.pwd}", "."
config.hiera.config_path = './tests/config'
@@ -7,7 +7,7 @@ module Puppet::Parser::Functions
raise(Puppet::ParseError, "write_erl_args(): Wrong number of arguments " +
"given (#{args.size} for 1 or 2)") if args.size < 1
-
+
if args[0].is_a? Array
args = args[0]
end
@@ -18,4 +18,4 @@ module Puppet::Parser::Functions
::Puppet::Parser::Util::Args.new(h).send(s)
end
-end
+end
View
@@ -4,7 +4,7 @@
# == Parameters
#
# cfg:
-# A configuration hash of erlang to be written to
+# A configuration hash of erlang to be written to
# File[/etc/riak/app.config]. It's recommended to browse
# the 'appconfig.pp' file to see sample values.
#
@@ -86,8 +86,10 @@
lager => {
handlers => {
lager_file_backend => [
- ['__tuple', $riak::params::error_log, '__atom_error', 10485760, '$D0', 5],
- ['__tuple', $riak::params::info_log, '__atom_info' , 10485760, '$D0', 5]
+ ['__tuple', $riak::params::error_log, '__atom_error',
+ 10485760, '$D0', 5],
+ ['__tuple', $riak::params::info_log, '__atom_info',
+ 10485760, '$D0', 5]
],
crash_log => $riak::params::crash_log,
crash_log_msg_side => 65536,
@@ -140,7 +142,7 @@
$appcfg[riak_core][platform_data_dir]
]:
ensure => directory,
- mode => 0755,
+ mode => '0755',
owner => 'riak'
}
View
@@ -80,7 +80,7 @@
$erl_log_dir = hiera('erl_log_dir', $riak::params::erl_log_dir),
$etc_dir = hiera('etc_dir', $riak::params::etc_dir),
$data_dir = hiera('data_dir', $riak::params::data_dir),
- $service_autorestart = hiera('service_autorestart',
+ $service_autorestart = hiera('service_autorestart',
$riak::params::service_autorestart
),
$cfg = hiera_hash('cfg', {}),
@@ -161,7 +161,7 @@
source => $url_source,
hash => $actual_hash
}
-
+
package { $riak::params::deps:
ensure => $manage_package
}
View
@@ -41,6 +41,6 @@
$lib_dir = '/usr/lib/riak'
$bin_dir = '/usr/sbin'
$etc_dir = '/etc/riak'
-
+
$service_autorestart = true
}
View
@@ -36,7 +36,7 @@
'' => write_erl_args(vmargs_cfg),
default => template($template)
}
-
+
$manage_source = $source ? {
'' => undef,
default => $source
@@ -0,0 +1,15 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+require 'spec_helper'
+
+describe 'write_erl_args', :type => :puppet_function do
+ it { subject.call({
+ '-name' => 'riak-5',
+ '-env' => {
+ :ERL_MAX_PORTS => 4096
+ }
+ }).
+ should eq(
+"-env ERL_MAX_PORTS 4096
+-name riak-5") }
+end

0 comments on commit 613d5b0

Please sign in to comment.