Sha256: ce42bd74b2e4096d2caa3c9be179e4945d9bfe11aa49fa08dcd355b36f97460c

Contents?: true

Size: 496 Bytes

Versions: 36

Compression:

Stored size: 496 Bytes

Contents

require "rspec/expectations"
require "spec/support/platform_helpers"

RSpec::Matchers.define :match_environment_variable do |varname|
  match do |actual|
    expected = if windows? && ENV[varname].nil?
                 # On Windows, if an environment variable is not set, the command
                 # `echo %VARNAME%` outputs %VARNAME%
                 "%#{varname}%"
               else
                 ENV[varname].to_s
               end

    actual == expected
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
knife-17.10.163 spec/support/shared/matchers/match_environment_variable.rb
knife-18.2.7 spec/support/shared/matchers/match_environment_variable.rb
knife-18.2.5 spec/support/shared/matchers/match_environment_variable.rb
knife-18.0.185 spec/support/shared/matchers/match_environment_variable.rb
chef-14.13.11-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-15.0.300-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-15.0.298-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-15.0.293-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.12.9-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.12.3-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-13.12.14-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.11.21-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.10.9-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.9.13-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.8.12-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.7.17-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-13.12.3-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.6.47-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-13.11.3-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb
chef-14.5.33-universal-mingw32 spec/support/shared/matchers/match_environment_variable.rb