From 07fa1728060059075b41e6a97a269dc8bed7e5b2 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 24 Jul 2024 16:48:17 +0200 Subject: [PATCH] Use exact expectations in perf_spec This makes it easier to debug when they don't match. --- spec/beaker/perf_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/beaker/perf_spec.rb b/spec/beaker/perf_spec.rb index 3c6173ddd..efe71ccea 100644 --- a/spec/beaker/perf_spec.rb +++ b/spec/beaker/perf_spec.rb @@ -30,7 +30,7 @@ module Beaker @my_logger.remove_destination(STDOUT) perf = described_class.new(hosts, @options) expect(perf).to be_a described_class - expect(@my_io.string).to match(/Setup perf on host: myHost/) + expect(@my_io.string).to eq("Setup perf on host: myHost\n") end it 'creates a new Perf object with multiple hosts' do @@ -39,7 +39,7 @@ module Beaker @my_logger.remove_destination(STDOUT) perf = described_class.new(hosts, @options) expect(perf).to be_a described_class - expect(@my_io.string).to match(/Setup perf on host: myHost*\nSetup perf on host: myOtherHost/) + expect(@my_io.string).to eq("Setup perf on host: myHost\nSetup perf on host: myOtherHost\n") end it 'creates a new Perf object with multiple hosts, SLES' do @@ -50,7 +50,7 @@ module Beaker @my_logger.remove_destination(STDOUT) perf = described_class.new(hosts, @options) expect(perf).to be_a described_class - expect(@my_io.string).to match(/Setup perf on host: myHost\nSetup perf on host: myOtherHost/) + expect(@my_io.string).to include("Setup perf on host: myHost\nSetup perf on host: myOtherHost\n") end end @@ -73,7 +73,7 @@ module Beaker perf = described_class.new(@hosts, @options) expect(perf).to be_a described_class perf.print_perf_info - expect(@my_io.string).to match(/Setup perf on host: myHost\nSetup perf on host: myOtherHost\nPerf \(sysstat\) not supported on host: myOtherHost\nGetting perf data for host: myHost\nGetting perf data for host: myOtherHost\nPerf \(sysstat\) not supported on host: myOtherHost/) + expect(@my_io.string).to eq("Setup perf on host: myHost\nSetup perf on host: myOtherHost\nPerf (sysstat) not supported on host: myOtherHost\nGetting perf data for host: myHost\nGetting perf data for host: myOtherHost\nPerf (sysstat) not supported on host: myOtherHost\n") end it "Does the Right Thing on non-Linux hosts" do @@ -82,7 +82,7 @@ module Beaker perf = described_class.new(@hosts, @options) expect(perf).to be_a described_class perf.print_perf_info - expect(@my_io.string).to match(/Setup perf on host: myHost\nPerf \(sysstat\) not supported on host: myHost\nSetup perf on host: myOtherHost\nPerf \(sysstat\) not supported on host: myOtherHost\nGetting perf data for host: myHost\nPerf \(sysstat\) not supported on host: myHost\nGetting perf data for host: myOtherHost\nPerf \(sysstat\) not supported on host: myOtherHost/) + expect(@my_io.string).to eq("Setup perf on host: myHost\nPerf (sysstat) not supported on host: myHost\nSetup perf on host: myOtherHost\nPerf (sysstat) not supported on host: myOtherHost\nGetting perf data for host: myHost\nPerf (sysstat) not supported on host: myHost\nGetting perf data for host: myOtherHost\nPerf (sysstat) not supported on host: myOtherHost\n") end end end