annotate modules/stdlib/spec/functions/prefix_spec.rb @ 320:99e3ca448d55

Fix Remi PHP on CentOS 8 It uses the new "modules" approach, so we need to use a new package provider They also use different signing keys
author IBBoard <dev@ibboard.co.uk>
date Sun, 01 Mar 2020 10:58:00 +0000
parents d9352a684e62
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
37
addb0ea390a1 Update Puppet "stdlib" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 require 'spec_helper'
addb0ea390a1 Update Puppet "stdlib" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
3 describe 'prefix' do
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
4 it { is_expected.not_to eq(nil) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
5 it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
6 it {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
7 pending('Current implementation ignores parameters after the second.')
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
8 is_expected.to run.with_params([], 'a', '').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i)
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
9 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
10 it { is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, %r{expected first argument to be an Array or a Hash}) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
11 it { is_expected.to run.with_params([], 2).and_raise_error(Puppet::ParseError, %r{expected second argument to be a String}) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
12 it { is_expected.to run.with_params([]).and_return([]) }
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
13 it { is_expected.to run.with_params(['one', 2]).and_return(['one', '2']) }
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
14 it { is_expected.to run.with_params(['ớņệ', 2]).and_return(['ớņệ', '2']) }
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
15 it { is_expected.to run.with_params([], '').and_return([]) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
16 it { is_expected.to run.with_params([''], '').and_return(['']) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
17 it { is_expected.to run.with_params(['one'], 'pre').and_return(['preone']) }
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
18 it { is_expected.to run.with_params(['one', 'two', 'three'], 'pre').and_return(['preone', 'pretwo', 'prethree']) }
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
19 it { is_expected.to run.with_params({}).and_return({}) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
20 it { is_expected.to run.with_params('key1' => 'value1', 2 => 3).and_return('key1' => 'value1', '2' => 3) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
21 it { is_expected.to run.with_params({}, '').and_return({}) }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
22 it { is_expected.to run.with_params({ 'key' => 'value' }, '').and_return('key' => 'value') }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
23 it { is_expected.to run.with_params({ 'key' => 'value' }, 'pre').and_return('prekey' => 'value') }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
24 it {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
25 is_expected.to run \
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
26 .with_params({ 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' }, 'pre') \
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
27 .and_return('prekey1' => 'value1', 'prekey2' => 'value2', 'prekey3' => 'value3')
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
28 }
37
addb0ea390a1 Update Puppet "stdlib" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 end