|
29 | 29 | describe '#builder' do |
30 | 30 | it 'should wrap catalog method' do |
31 | 31 | expect(@testobj.builder).to eq(@catalog.builder) |
| 32 | + expect(@testobj.builder).to be_a_kind_of(String) |
32 | 33 | end |
33 | 34 | end |
34 | 35 |
|
35 | | - describe '#catalog_json' do |
| 36 | + describe '#to_json' do |
36 | 37 | it 'should wrap catalog method' do |
37 | | - expect(@testobj.catalog_json).to eq(@catalog.catalog_json) |
| 38 | + expect(@testobj.to_json).to eq(@catalog.catalog_json) |
| 39 | + expect(@testobj.to_json).to be_a_kind_of(String) |
38 | 40 | end |
39 | 41 | end |
40 | 42 |
|
41 | 43 | describe '#compilation_dir' do |
42 | | - it 'should wrap catalog method' do |
| 44 | + it 'should wrap catalog method if nil' do |
43 | 45 | expect(@testobj.compilation_dir).to eq(@catalog.compilation_dir) |
| 46 | + expect(@testobj.compilation_dir).to be_nil |
| 47 | + end |
| 48 | + |
| 49 | + it 'should wrap catalog method if not nil' do |
| 50 | + expect(@catalog).to receive(:compilation_dir).and_return('foo') |
| 51 | + expect(@testobj.compilation_dir).to eq('foo') |
44 | 52 | end |
45 | 53 | end |
46 | 54 |
|
47 | 55 | describe '#error_message' do |
48 | | - it 'should wrap catalog method' do |
| 56 | + it 'should wrap catalog method if nil' do |
49 | 57 | expect(@testobj.error_message).to eq(@catalog.error_message) |
| 58 | + expect(@testobj.error_message).to be_nil |
| 59 | + end |
| 60 | + |
| 61 | + it 'should wrap catalog method if not nil' do |
| 62 | + expect(@catalog).to receive(:error_message).and_return('foo') |
| 63 | + expect(@testobj.error_message).to eq('foo') |
50 | 64 | end |
51 | 65 | end |
52 | 66 |
|
53 | 67 | describe '#puppet_version' do |
54 | | - it 'should wrap catalog method' do |
| 68 | + it 'should wrap catalog method if nil' do |
55 | 69 | expect(@testobj.puppet_version).to eq(@catalog.puppet_version) |
| 70 | + expect(@testobj.puppet_version).to be_nil |
| 71 | + end |
| 72 | + |
| 73 | + it 'should wrap catalog method if not nil' do |
| 74 | + expect(@catalog).to receive(:puppet_version).and_return('foo') |
| 75 | + expect(@testobj.puppet_version).to eq('foo') |
56 | 76 | end |
57 | 77 | end |
58 | 78 |
|
|
66 | 86 | describe '#resources' do |
67 | 87 | it 'should wrap catalog method' do |
68 | 88 | expect(@testobj.resources).to eq(@catalog.resources) |
| 89 | + expect(@testobj.resources).to be_a_kind_of(Array) |
69 | 90 | end |
70 | 91 | end |
71 | 92 |
|
72 | 93 | describe '#valid?' do |
73 | 94 | it 'should wrap catalog method' do |
74 | 95 | expect(@testobj.valid?).to eq(@catalog.valid?) |
| 96 | + expect(@testobj.valid?).to be_a_kind_of(TrueClass) |
| 97 | + end |
| 98 | + end |
| 99 | + |
| 100 | + describe '#to_h' do |
| 101 | + it 'should wrap catalog method' do |
| 102 | + expect(@testobj.to_h).to eq(@catalog.catalog) |
| 103 | + expect(@testobj.to_h).to be_a_kind_of(Hash) |
75 | 104 | end |
76 | 105 | end |
77 | 106 | end |
|
0 commit comments