mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
This is the First pass to add the `integration` test for the CLI, the Logstash and the logstash-plugin command. Fixes #5259 Fixes #5350
31 lines
776 B
Ruby
31 lines
776 B
Ruby
# encoding: utf-8
|
|
RSpec::Matchers.define :be_successful do
|
|
match do |actual|
|
|
actual.exit_status == 0
|
|
end
|
|
end
|
|
|
|
RSpec::Matchers.define :fail_and_output do |expected_output|
|
|
match do |actual|
|
|
actual.exit_status == 1 && actual.stderr =~ expected_output
|
|
end
|
|
end
|
|
|
|
RSpec::Matchers.define :run_successfully_and_output do |expected_output|
|
|
match do |actual|
|
|
(actual.exit_status == 0 || actual.exit_status.nil?) && actual.stdout =~ expected_output
|
|
end
|
|
end
|
|
|
|
RSpec::Matchers.define :have_installed? do |name,*args|
|
|
match do |actual|
|
|
version = args.first
|
|
actual.plugin_installed?(name, version)
|
|
end
|
|
end
|
|
|
|
RSpec::Matchers.define :install_successfully do
|
|
match do |cmd|
|
|
expect(cmd).to run_successfully_and_output(/Installation successful/)
|
|
end
|
|
end
|