File: env_spec.rb

package info (click to toggle)
ruby-specinfra 2.94.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,448 kB
  • sloc: ruby: 10,538; sh: 4; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 659 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'spec_helper'

set :backend, :exec

describe Specinfra.backend.run_command('echo $LANG').stdout.strip do
  it { should eq 'C' }
end

describe "override ENV with config(:env)" do
  before do
    set :backend, :exec

    ENV['LANG'] = 'C'
    set :env, :LANG => 'ja_JP.UTF-8'
  end
  let(:lang) { Specinfra.backend.run_command('echo $LANG').stdout.strip }
  it { expect(lang).to eq 'ja_JP.UTF-8' }
  it { expect(ENV['LANG']).to eq 'C' }
end

describe "clear env for BUNDLER" do
  before do
    set :backend, :exec

    ENV['BUNDLER_SETUP'] = 'any-value'
  end
  it { expect(Specinfra.backend.run_command('printenv BUNDLER_SETUP').stdout).to eq '' }
end