|
5 | 5 | let(:scope) { PuppetlabsSpec::PuppetInternals.scope } |
6 | 6 |
|
7 | 7 | it "should exist" do |
8 | | - Puppet::Parser::Functions.function("any2array").should == "function_any2array" |
| 8 | + expect(Puppet::Parser::Functions.function("any2array")).to eq("function_any2array") |
9 | 9 | end |
10 | 10 |
|
11 | 11 | it "should return an empty array if there is less than 1 argument" do |
12 | 12 | result = scope.function_any2array([]) |
13 | | - result.should(eq([])) |
| 13 | + expect(result).to(eq([])) |
14 | 14 | end |
15 | 15 |
|
16 | 16 | it "should convert boolean true to [ true ] " do |
17 | 17 | result = scope.function_any2array([true]) |
18 | | - result.should(eq([true])) |
| 18 | + expect(result).to(eq([true])) |
19 | 19 | end |
20 | 20 |
|
21 | 21 | it "should convert one object to [object]" do |
22 | 22 | result = scope.function_any2array(['one']) |
23 | | - result.should(eq(['one'])) |
| 23 | + expect(result).to(eq(['one'])) |
24 | 24 | end |
25 | 25 |
|
26 | 26 | it "should convert multiple objects to [objects]" do |
27 | 27 | result = scope.function_any2array(['one', 'two']) |
28 | | - result.should(eq(['one', 'two'])) |
| 28 | + expect(result).to(eq(['one', 'two'])) |
29 | 29 | end |
30 | 30 |
|
31 | 31 | it "should return empty array it was called with" do |
32 | 32 | result = scope.function_any2array([[]]) |
33 | | - result.should(eq([])) |
| 33 | + expect(result).to(eq([])) |
34 | 34 | end |
35 | 35 |
|
36 | 36 | it "should return one-member array it was called with" do |
37 | 37 | result = scope.function_any2array([['string']]) |
38 | | - result.should(eq(['string'])) |
| 38 | + expect(result).to(eq(['string'])) |
39 | 39 | end |
40 | 40 |
|
41 | 41 | it "should return multi-member array it was called with" do |
42 | 42 | result = scope.function_any2array([['one', 'two']]) |
43 | | - result.should(eq(['one', 'two'])) |
| 43 | + expect(result).to(eq(['one', 'two'])) |
44 | 44 | end |
45 | 45 |
|
46 | 46 | it "should return members of a hash it was called with" do |
47 | 47 | result = scope.function_any2array([{ 'key' => 'value' }]) |
48 | | - result.should(eq(['key', 'value'])) |
| 48 | + expect(result).to(eq(['key', 'value'])) |
49 | 49 | end |
50 | 50 |
|
51 | 51 | it "should return an empty array if it was called with an empty hash" do |
52 | 52 | result = scope.function_any2array([{ }]) |
53 | | - result.should(eq([])) |
| 53 | + expect(result).to(eq([])) |
54 | 54 | end |
55 | 55 | end |
0 commit comments