blob: c8c905f44afe6e39bac6a2c654dcd8f2fbb0db9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
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
|