Sha256: 39b630d21e48993c54f161118935c7565c1fcfee774107458daed08904da9c4d

Contents?: true

Size: 686 Bytes

Versions: 12

Compression:

Stored size: 686 Bytes

Contents

require 'spec_helper'

RSpec.describe Aruba::Platforms::WindowsCommandString do
  let(:command_string) { described_class.new(base_command) }
  let(:cmd_path) { 'C:\Some Path\cmd.exe' }

  before do
    allow(Aruba.platform).to receive(:which).with('cmd.exe').and_return(cmd_path)
  end

  describe '#to_a' do
    context 'with a command with a path' do
      let(:base_command) { 'C:\Foo\Bar' }
      it { expect(command_string.to_a).to eq [cmd_path, '/c', base_command] }
    end

    context 'with a command with a path containing spaces' do
      let(:base_command) { 'C:\Foo Bar\Baz' }
      it { expect(command_string.to_a).to eq [cmd_path, '/c', base_command] }
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
aruba-0.14.14 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.13 spec/aruba/platforms/windows_command_string_spec.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/aruba-0.14.12/spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.12 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.11 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.10 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.9 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.8 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.7 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.6 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.5 spec/aruba/platforms/windows_command_string_spec.rb
aruba-0.14.4 spec/aruba/platforms/windows_command_string_spec.rb