spec/unit/nodes_spec.rb in kitchen-nodes-0.9.0 vs spec/unit/nodes_spec.rb in kitchen-nodes-0.9.1
- old
+ new
@@ -4,11 +4,13 @@
require 'kitchen/driver/dummy'
require 'kitchen/provisioner/nodes'
require 'kitchen/transport/dummy'
require 'kitchen/transport/winrm'
require 'kitchen/transport/ssh'
+require 'winrm'
+# rubocop:disable Metrics/BlockLength
describe Kitchen::Provisioner::Nodes do
let(:config) do
{
test_base_path: '/b',
kitchen_root: '/r',
@@ -154,13 +156,14 @@
context 'platform is windows' do
let(:transport) { Kitchen::Transport::Winrm.new }
before do
- data = machine_ips.map { |ip| { stdout: "IPv4 Address .: #{ip}\r\n" } }
- data = data.insert(0, stdout: "\r\n")
+ data = WinRM::Output.new
+ data << { stdout: "\r\n" }
+ machine_ips.map { |ip| data << { stdout: "IPv4 Address .: #{ip}\r\n" } }
allow_any_instance_of(Kitchen::Transport::Base::Connection).to(
- receive(:node_execute).and_return(data: data)
+ receive(:node_execute).and_return(data)
)
allow(platform).to receive(:name).and_return('windows')
end
it 'sets the ip address to the first reachable IP' do