Skip to content

Commit 50cd512

Browse files
committed
spec: escape expected output in regexp
1 parent a56321d commit 50cd512

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

qa/integration/specs/cli/list_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def parse_output(output)
6262
plugins = list_command.stderr_and_stdout.split(/\n(?! )/)
6363

6464
integration_plugin = plugins.find { |plugin_output| plugin_output.match(/^logstash-integration-jdbc\b/) }
65-
expect(integration_plugin).to match(/^#{sub_heading_pattern} logstash-input-jdbc$/)
66-
expect(integration_plugin).to match(/^#{sub_heading_pattern} logstash-filter-jdbc_static$/)
65+
expect(integration_plugin).to match(/^#{sub_heading_pattern} #{Regexp.escape("logstash-input-jdbc")}$/)
66+
expect(integration_plugin).to match(/^#{sub_heading_pattern} #{Regexp.escape("logstash-filter-jdbc_static")}$/)
6767
end
6868

6969
it "expands plugin aliases" do
@@ -72,7 +72,7 @@ def parse_output(output)
7272
plugins = list_command.stderr_and_stdout.split(/\n(?! )/)
7373

7474
alias_plugin = plugins.find { |plugin_output| plugin_output.match(/^logstash-input-beats\b/) }
75-
expect(alias_plugin).to match(/^#{sub_heading_pattern} logstash-input-elastic_agent (alias)$/)
75+
expect(alias_plugin).to match(/^#{sub_heading_pattern} #{Regexp.escape("logstash-input-elastic_agent (alias)")}$/)
7676
end
7777

7878
context "--no-expand" do

0 commit comments

Comments
 (0)