rspec testing with array

asked 2015-06-02 07:28:59 -0600

Chutki gravatar image


Below is my manifests

hieratest {

    "file1" : number => "1";
    "file2" : number => "2";

  define hieratest($number) {

    file {"/tmp/${number}":
      ensure => present

Below is rspec I wrote for the above manifests

require 'spec_helper'

describe 'test::test_file' do

  it { should contain_file('/tmp/1','/tmp/2').with({:ensure => 'present'}) }


It is working without any error. But wanna know is there any better way to write multiple file creation for rspec testing.

edit retag flag offensive close merge delete