1 | require 'spec_helper'
|
---|
2 |
|
---|
3 | describe 'rstrip' do
|
---|
4 | it { is_expected.not_to eq(nil) }
|
---|
5 | it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
|
---|
6 | it {
|
---|
7 | pending("Current implementation ignores parameters after the first.")
|
---|
8 | is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
|
---|
9 | }
|
---|
10 | it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
|
---|
11 | it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
|
---|
12 | it { is_expected.to run.with_params('').and_return('') }
|
---|
13 | it { is_expected.to run.with_params(' ').and_return('') }
|
---|
14 | it { is_expected.to run.with_params(' ').and_return('') }
|
---|
15 | it { is_expected.to run.with_params("\t").and_return('') }
|
---|
16 | it { is_expected.to run.with_params("\t ").and_return('') }
|
---|
17 | it { is_expected.to run.with_params('one').and_return('one') }
|
---|
18 | it { is_expected.to run.with_params(' one').and_return(' one') }
|
---|
19 | it { is_expected.to run.with_params(' one').and_return(' one') }
|
---|
20 | it { is_expected.to run.with_params("\tone").and_return("\tone") }
|
---|
21 | it { is_expected.to run.with_params("\t one").and_return("\t one") }
|
---|
22 | it { is_expected.to run.with_params('one ').and_return('one') }
|
---|
23 | it { is_expected.to run.with_params(' one ').and_return(' one') }
|
---|
24 | it { is_expected.to run.with_params(' one ').and_return(' one') }
|
---|
25 | it { is_expected.to run.with_params("\tone ").and_return("\tone") }
|
---|
26 | it { is_expected.to run.with_params("\t one ").and_return("\t one") }
|
---|
27 | it { is_expected.to run.with_params("one\t").and_return('one') }
|
---|
28 | it { is_expected.to run.with_params(" one\t").and_return(' one') }
|
---|
29 | it { is_expected.to run.with_params(" one\t").and_return(' one') }
|
---|
30 | it { is_expected.to run.with_params("\tone\t").and_return("\tone") }
|
---|
31 | it { is_expected.to run.with_params("\t one\t").and_return("\t one") }
|
---|
32 | it { is_expected.to run.with_params(' o n e ').and_return(' o n e') }
|
---|
33 | it { is_expected.to run.with_params(AlsoString.new(' one ')).and_return(' one') }
|
---|
34 | end
|
---|