|
123 | 123 | provider.install
|
124 | 124 | end
|
125 | 125 |
|
126 |
| - it "should just enable the module if it has no default profile(missing groups or modules)" do |
| 126 | + it "should just enable the module if it has no default profile (missing groups or modules)" do |
127 | 127 | dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nmissing groups or modules: #{resource[:name]}")
|
128 | 128 | allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
|
129 | 129 | resource[:ensure] = :present
|
|
132 | 132 | provider.install
|
133 | 133 | end
|
134 | 134 |
|
135 |
| - it "should just enable the module if it has no default profile(broken groups or modules)" do |
| 135 | + it "should just enable the module with the right stream if it has no default profile (missing groups or modules)" do |
| 136 | + stream = '12.3' |
| 137 | + dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nmissing groups or modules: #{resource[:name]}:#{stream}") |
| 138 | + allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception) |
| 139 | + resource[:ensure] = stream |
| 140 | + expect(provider).to receive(:execute).with(array_including('install')).ordered |
| 141 | + expect(provider).to receive(:execute).with(array_including('enable')).ordered |
| 142 | + provider.install |
| 143 | + end |
| 144 | + |
| 145 | + it "should just enable the module if it has no default profile (broken groups or modules)" do |
136 | 146 | dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nbroken groups or modules: #{resource[:name]}")
|
137 | 147 | allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
|
138 | 148 | resource[:ensure] = :present
|
|
141 | 151 | provider.install
|
142 | 152 | end
|
143 | 153 |
|
| 154 | + it "should just enable the module with the right stream if it has no default profile (broken groups or modules)" do |
| 155 | + stream = '12.3' |
| 156 | + dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nbroken groups or modules: #{resource[:name]}:#{stream}") |
| 157 | + allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception) |
| 158 | + resource[:ensure] = stream |
| 159 | + expect(provider).to receive(:execute).with(array_including('install')).ordered |
| 160 | + expect(provider).to receive(:execute).with(array_including('enable')).ordered |
| 161 | + provider.install |
| 162 | + end |
| 163 | + |
144 | 164 | it "should just enable the module if enable_only = true" do
|
145 | 165 | resource[:ensure] = :present
|
146 | 166 | resource[:enable_only] = true
|
|
0 commit comments