source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/functions/delete_at_spec.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 7 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1require 'spec_helper'
2
3describe 'delete_at' do
4 it { is_expected.not_to eq(nil) }
5 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
6 it { is_expected.to run.with_params('one', 1).and_raise_error(Puppet::ParseError) }
7 it { is_expected.to run.with_params(1, 1).and_raise_error(Puppet::ParseError) }
8 it { is_expected.to run.with_params(['one'], 'two').and_raise_error(Puppet::ParseError) }
9 it {
10 pending("Current implementation ignores parameters after the first two.")
11 is_expected.to run.with_params(['one'], 0, 1).and_raise_error(Puppet::ParseError)
12 }
13
14 describe 'argument validation' do
15 it { is_expected.to run.with_params([0, 1, 2], 3).and_raise_error(Puppet::ParseError) }
16 end
17
18 it { is_expected.to run.with_params([0, 1, 2], 1).and_return([0, 2]) }
19 it { is_expected.to run.with_params([0, 1, 2], -1).and_return([0, 1]) }
20 it { is_expected.to run.with_params([0, 1, 2], -4).and_return([0, 1, 2]) }
21
22 it "should leave the original array intact" do
23 argument = [1, 2, 3]
24 original = argument.dup
25 result = subject.call([argument,2])
26 expect(argument).to eq(original)
27 end
28end
Note: See TracBrowser for help on using the repository browser.