|
2110 | 2110 | end
|
2111 | 2111 |
|
2112 | 2112 | describe '.ps_manager' do
|
2113 |
| - before do |
2114 |
| - allow(Pwsh::Manager).to receive(:powershell_path).and_return('pwsh') |
2115 |
| - allow(Pwsh::Manager).to receive(:powershell_args).and_return('args') |
2116 |
| - end |
| 2113 | + describe '.ps_manager on non-Windows' do |
| 2114 | + before do |
| 2115 | + allow(Pwsh::Util).to receive(:on_windows?).and_return(false) |
| 2116 | + allow(Pwsh::Manager).to receive(:pwsh_path).and_return('pwsh') |
| 2117 | + allow(Pwsh::Manager).to receive(:pwsh_args).and_return('args') |
| 2118 | + end |
2117 | 2119 |
|
2118 |
| - it 'Initializes an instance of the Pwsh::Manager' do |
2119 |
| - expect(Puppet::Util::Log).to receive(:level).and_return(:normal) |
2120 |
| - expect(Pwsh::Manager).to receive(:instance).with('pwsh', 'args', debug: false) |
2121 |
| - expect { provider.ps_manager }.not_to raise_error |
| 2120 | + it 'Initializes an instance of the Pwsh::Manager' do |
| 2121 | + expect(Puppet::Util::Log).to receive(:level).and_return(:normal) |
| 2122 | + expect(Pwsh::Manager).to receive(:instance).with('pwsh', 'args', debug: false) |
| 2123 | + expect { provider.ps_manager }.not_to raise_error |
| 2124 | + end |
| 2125 | + |
| 2126 | + it 'passes debug as true if Puppet::Util::Log.level is debug' do |
| 2127 | + expect(Puppet::Util::Log).to receive(:level).and_return(:debug) |
| 2128 | + expect(Pwsh::Manager).to receive(:instance).with('pwsh', 'args', debug: true) |
| 2129 | + expect { provider.ps_manager }.not_to raise_error |
| 2130 | + end |
2122 | 2131 | end
|
2123 | 2132 |
|
2124 |
| - it 'passes debug as true if Puppet::Util::Log.level is debug' do |
2125 |
| - expect(Puppet::Util::Log).to receive(:level).and_return(:debug) |
2126 |
| - expect(Pwsh::Manager).to receive(:instance).with('pwsh', 'args', debug: true) |
2127 |
| - expect { provider.ps_manager }.not_to raise_error |
| 2133 | + describe '.ps_manager on Windows' do |
| 2134 | + before do |
| 2135 | + allow(Pwsh::Util).to receive(:on_windows?).and_return(true) |
| 2136 | + allow(Pwsh::Manager).to receive(:powershell_path).and_return('pwsh') |
| 2137 | + allow(Pwsh::Manager).to receive(:powershell_args).and_return('args') |
| 2138 | + end |
| 2139 | + |
| 2140 | + it 'Initializes an instance of the Pwsh::Manager' do |
| 2141 | + expect(Puppet::Util::Log).to receive(:level).and_return(:normal) |
| 2142 | + expect(Pwsh::Manager).to receive(:instance).with('pwsh', 'args', debug: false) |
| 2143 | + expect { provider.ps_manager }.not_to raise_error |
| 2144 | + end |
| 2145 | + |
| 2146 | + it 'passes debug as true if Puppet::Util::Log.level is debug' do |
| 2147 | + expect(Puppet::Util::Log).to receive(:level).and_return(:debug) |
| 2148 | + expect(Pwsh::Manager).to receive(:instance).with('pwsh', 'args', debug: true) |
| 2149 | + expect { provider.ps_manager }.not_to raise_error |
| 2150 | + end |
2128 | 2151 | end
|
2129 | 2152 | end
|
2130 | 2153 | end
|
0 commit comments