|
16 | 16 | :ensure => :present,
|
17 | 17 | :home => '/u01/app/oracle/product/9.2.0.1.0',
|
18 | 18 | :atboot => :yes,
|
19 |
| - :description => 'managed by puppet', |
| 19 | + :description => 'managed by puppet' |
20 | 20 | )
|
21 | 21 | end
|
22 | 22 |
|
23 | 23 | [:destroy, :create, :exists?].each do |method|
|
24 | 24 | it "should respond to #{method}" do
|
25 |
| - provider.should respond_to method |
| 25 | + expect(provider).to respond_to method |
26 | 26 | end
|
27 | 27 | end
|
28 | 28 |
|
29 | 29 | [:home, :atboot, :description].each do |property|
|
30 | 30 | it "should have getter and setter for property #{property}" do
|
31 |
| - provider.should respond_to property |
32 |
| - provider.should respond_to "#{property}=".intern |
| 31 | + expect(provider).to respond_to property |
| 32 | + expect(provider).to respond_to "#{property}=".intern |
33 | 33 | end
|
34 | 34 | end
|
35 | 35 |
|
36 | 36 | describe "when parsing a line" do
|
37 | 37 |
|
38 | 38 | describe "with no description" do
|
39 | 39 | it "should capture the name" do
|
40 |
| - described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N')[:name].should == 'TEST' |
41 |
| - described_class.parse_line('TEST_01:/app/oracle/db/11.2/db_1:N')[:name].should == 'TEST_01' |
| 40 | + expect(described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N')[:name]).to eq('TEST') |
| 41 | + expect(described_class.parse_line('TEST_01:/app/oracle/db/11.2/db_1:N')[:name]).to eq('TEST_01') |
42 | 42 | end
|
43 | 43 |
|
44 | 44 | it "should capture the home directory" do
|
45 |
| - described_class.parse_line('TEST:/db_1:N')[:home].should == '/db_1' |
46 |
| - described_class.parse_line('TEST:/db_1:Y')[:home].should == '/db_1' |
47 |
| - described_class.parse_line('TEST_01:/app/oracle/db/11.2/db_1:Y')[:home].should == '/app/oracle/db/11.2/db_1' |
| 45 | + expect(described_class.parse_line('TEST:/db_1:N')[:home]).to eq('/db_1') |
| 46 | + expect(described_class.parse_line('TEST:/db_1:Y')[:home]).to eq('/db_1') |
| 47 | + expect(described_class.parse_line('TEST_01:/app/oracle/db/11.2/db_1:Y')[:home]).to eq('/app/oracle/db/11.2/db_1') |
48 | 48 | end
|
49 | 49 |
|
50 | 50 | it "should capture the atboot flag" do
|
51 |
| - described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N')[:atboot].should == :no |
52 |
| - described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:Y')[:atboot].should == :yes |
| 51 | + expect(described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N')[:atboot]).to eq(:no) |
| 52 | + expect(described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:Y')[:atboot]).to eq(:yes) |
53 | 53 | end
|
54 | 54 | end
|
55 | 55 |
|
56 | 56 | describe "with a description" do
|
57 | 57 | it "should capture the name" do
|
58 |
| - described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N # fancy comment')[:name].should == 'TEST' |
59 |
| - described_class.parse_line('TEST_01:/app/oracle/db/11.2/db_1:N # even ## fancier')[:name].should == 'TEST_01' |
| 58 | + expect(described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N # fancy comment')[:name]).to eq('TEST') |
| 59 | + expect(described_class.parse_line('TEST_01:/app/oracle/db/11.2/db_1:N # even ## fancier')[:name]).to eq('TEST_01') |
60 | 60 | end
|
61 | 61 | it "should capture the home directory" do
|
62 |
| - described_class.parse_line('TEST:/db_1:N # fancy comment')[:home].should == '/db_1' |
63 |
| - described_class.parse_line('TEST_01:/app/oracle/db/11.2/db_1:Y# even ## fancier')[:home].should == '/app/oracle/db/11.2/db_1' |
| 62 | + expect(described_class.parse_line('TEST:/db_1:N # fancy comment')[:home]).to eq('/db_1') |
| 63 | + expect(described_class.parse_line('TEST_01:/app/oracle/db/11.2/db_1:Y# even ## fancier')[:home]).to eq('/app/oracle/db/11.2/db_1') |
64 | 64 | end
|
65 | 65 | it "should capture the atboot flag" do
|
66 |
| - described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N # fancy comment')[:atboot].should == :no |
67 |
| - described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:Y## even ## fancier')[:atboot].should == :yes |
| 66 | + expect(described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N # fancy comment')[:atboot]).to eq(:no) |
| 67 | + expect(described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:Y## even ## fancier')[:atboot]).to eq(:yes) |
68 | 68 | end
|
69 | 69 | it "should capture the description" do
|
70 |
| - described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N # fancy comment')[:description].should == 'fancy comment' |
71 |
| - described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:Y## even ## fancier')[:description].should == '# even ## fancier' |
| 70 | + expect(described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:N # fancy comment')[:description]).to eq('fancy comment') |
| 71 | + expect(described_class.parse_line('TEST:/app/oracle/db/11.2/db_1:Y## even ## fancier')[:description]).to eq('# even ## fancier') |
72 | 72 | end
|
73 | 73 | end
|
74 | 74 | end
|
75 | 75 |
|
76 | 76 | describe "when calling instances" do
|
77 | 77 | before :each do
|
78 | 78 | @instances = described_class.instances
|
79 |
| - @instances.size.should == 3 |
| 79 | + expect(@instances.size).to eq(3) |
80 | 80 | end
|
81 | 81 |
|
82 | 82 | it "should be able to get the first entry" do
|
83 |
| - @instances[0].get(:name).should == 'TEST' |
84 |
| - @instances[0].get(:home).should == '/app/oracle/db/11.2/db_1' |
85 |
| - @instances[0].get(:atboot).should == :no |
86 |
| - @instances[0].get(:description).should == 'line added by Agent' |
| 83 | + expect(@instances[0].get(:name)).to eq('TEST') |
| 84 | + expect(@instances[0].get(:home)).to eq('/app/oracle/db/11.2/db_1') |
| 85 | + expect(@instances[0].get(:atboot)).to eq(:no) |
| 86 | + expect(@instances[0].get(:description)).to eq('line added by Agent') |
87 | 87 | end
|
88 | 88 |
|
89 | 89 | it "should be able to get the second entry" do
|
90 |
| - @instances[1].get(:name).should == 'PROD' |
91 |
| - @instances[1].get(:home).should == '/app/oracle/db/11.2/db_2' |
92 |
| - @instances[1].get(:atboot).should == :yes |
93 |
| - @instances[1].get(:description).should == :absent |
| 90 | + expect(@instances[1].get(:name)).to eq('PROD') |
| 91 | + expect(@instances[1].get(:home)).to eq('/app/oracle/db/11.2/db_2') |
| 92 | + expect(@instances[1].get(:atboot)).to eq(:yes) |
| 93 | + expect(@instances[1].get(:description)).to eq(:absent) |
94 | 94 | end
|
95 | 95 |
|
96 | 96 | it "should be able to get the third entry" do
|
97 |
| - @instances[2].get(:name).should == 'DR' |
98 |
| - @instances[2].get(:home).should == '/app/oracle/db/11.2/db_4' |
99 |
| - @instances[2].get(:atboot).should == :no |
100 |
| - @instances[2].get(:description).should == 'i am still # an inline comment' |
| 97 | + expect(@instances[2].get(:name)).to eq('DR') |
| 98 | + expect(@instances[2].get(:home)).to eq('/app/oracle/db/11.2/db_4') |
| 99 | + expect(@instances[2].get(:atboot)).to eq(:no) |
| 100 | + expect(@instances[2].get(:description)).to eq('i am still # an inline comment') |
101 | 101 | end
|
102 | 102 | end
|
103 | 103 |
|
|
0 commit comments