Sha256: 1dbd998bc7b530a0eb80a8a024a05c4c532e37d8133a5cfa3c6cfd399290c1fb

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'

describe VagrantWindows::Communication::WinRMCommunicator, :integration => true do
  
  before(:all) do
    # This test requires you already have a running Windows Server 2008 R2 Vagrant VM
    # Not ideal, but you have to start somewhere
    @shell = VagrantWindows::Communication::WinRMShell.new("localhost", "vagrant", "vagrant")
    @communicator = VagrantWindows::Communication::WinRMCommunicator.new({})
    @communicator.set_winrmshell(@shell)
  end
  
  describe "execute" do
    it "should return 1" do
      expect(@communicator.execute("exit 1")).to eq(1)
    end
    
    it "should return 1 with block" do
      exit_code = @communicator.sudo("exit 1", {}) do |type, line|
        puts line
      end
      expect(exit_code).to eq(1)
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-windows-1.2.1 spec/vagrant-windows/winrmcommunicator_spec.rb
vagrant-windows-1.2.0 spec/vagrant-windows/winrmcommunicator_spec.rb