Sha256: 6d092f3bd8f0cf4a9772f6f37783738834b5b00ef9425df552e070cde6da79d5

Contents?: true

Size: 643 Bytes

Versions: 5

Compression:

Stored size: 643 Bytes

Contents

require 'spec_helper'

describe "Cmds ENV vars" do
  r_echo_cmd = %{ruby -e "puts ENV['BLAH']"}
  
  it "sets basic (path-like) string ENV var" do
    cmd = Cmds.new r_echo_cmd, env: {BLAH: "x:y:z"}
    expect(cmd.chomp!).to eq "x:y:z"
  end
  
  it "sets a string with spaces in it correctly" do
    cmd = Cmds.new r_echo_cmd, env: {BLAH: "hey there"}
    expect(cmd.chomp!).to eq "hey there"
  end
  
  it "accepts string keys" do
    cmd = Cmds.new r_echo_cmd, env: {
      'BLAH' => [
        "/usr/local/bin",
        "/usr/bin",
        "/bin"
      ].join(':')
    }
    expect(cmd.chomp!).to eq "/usr/local/bin:/usr/bin:/bin"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cmds-0.2.4 spec/cmds/env_spec.rb
cmds-0.2.3 spec/cmds/env_spec.rb
cmds-0.2.2 spec/cmds/env_spec.rb
cmds-0.2.1 spec/cmds/env_spec.rb
cmds-0.2.0 spec/cmds/env_spec.rb