About | FAQ | Help
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Looks like the fact $::blockdevices is undefined causing split to throw an error. Since you are using rspec you need to explicitly define every fact you use.

See the following for an example of defining facts in a spec file: https://github.com/puppetlabs/puppetlabs-apache/blob/master/spec/classes/dev_spec.rb#L8

Also you can try this out on the Puppet REPL if you just want to test the function.