mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
parent
9f1d889c27
commit
6bf4eddaff
1 changed files with 5 additions and 1 deletions
|
@ -160,12 +160,14 @@ describe LogStash::Settings do
|
|||
settings = described_class.new
|
||||
settings.register(LogStash::Setting::String.new("interpolated", "missing"))
|
||||
settings.register(LogStash::Setting::String.new("with_dot", "missing"))
|
||||
settings.register(LogStash::Setting::String.new("windows_notation", "missing"))
|
||||
settings
|
||||
end
|
||||
|
||||
let(:values) {{
|
||||
"interpolated" => "${SOME_LOGSTASH_SPEC_ENV_VAR}",
|
||||
"with_dot" => "${some.logstash.spec.env.var}"
|
||||
"with_dot" => "${some.logstash.spec.env.var}",
|
||||
"windows_notation" => "%SOME_LOGSTASH_SPEC_ENV_VAR%",
|
||||
}}
|
||||
let(:yaml_path) do
|
||||
p = Stud::Temporary.pathname
|
||||
|
@ -180,11 +182,13 @@ describe LogStash::Settings do
|
|||
it "can interpolate environment into settings" do
|
||||
expect(subject.get('interpolated')).to eq("missing")
|
||||
expect(subject.get('with_dot')).to eq("missing")
|
||||
expect(subject.get('windows_notation')).to eq("missing")
|
||||
ENV['SOME_LOGSTASH_SPEC_ENV_VAR'] = "correct_setting"
|
||||
ENV['some.logstash.spec.env.var'] = "correct_setting_for_dotted"
|
||||
subject.from_yaml(yaml_path)
|
||||
expect(subject.get('interpolated')).to eq("correct_setting")
|
||||
expect(subject.get('with_dot')).to eq("correct_setting_for_dotted")
|
||||
expect(subject.get('windows_notation')).to eq("correct_setting")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue