From 3dd6f5918e14c0e3d6bab372175be3644326cf7c Mon Sep 17 00:00:00 2001 From: Lovro Bikic Date: Sat, 14 Aug 2021 09:43:57 +0200 Subject: [PATCH 1/3] Don't exclude specs with tag ssh No specs were using the tag --- .rspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rspec b/.rspec index 51fd40ee..b8f626ef 100644 --- a/.rspec +++ b/.rspec @@ -1 +1 @@ --c --order rand -t ~ssh +-c --order rand From 080df2addc7691e191753a6b153c63ba99763bef Mon Sep 17 00:00:00 2001 From: Lovro Bikic Date: Sat, 14 Aug 2021 09:45:16 +0200 Subject: [PATCH 2/3] Test for output so it doesn't go to stdout --- spec/lib/mina/configuration_spec.rb | 1 + spec/tasks/default_spec.rb | 1 + spec/tasks/init_spec.rb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/lib/mina/configuration_spec.rb b/spec/lib/mina/configuration_spec.rb index 71a23e2a..9672954c 100644 --- a/spec/lib/mina/configuration_spec.rb +++ b/spec/lib/mina/configuration_spec.rb @@ -47,6 +47,7 @@ it 'raises an error if key is not set' do expect { config.ensure!(:key) }.to raise_error(SystemExit) + .and output(/key must be defined!/).to_stdout end end diff --git a/spec/tasks/default_spec.rb b/spec/tasks/default_spec.rb index c90dd996..80818aa9 100644 --- a/spec/tasks/default_spec.rb +++ b/spec/tasks/default_spec.rb @@ -16,6 +16,7 @@ it 'exits if no command given' do expect { subject.invoke }.to raise_error(SystemExit) + .and output(/You need to provide a command/).to_stdout end end diff --git a/spec/tasks/init_spec.rb b/spec/tasks/init_spec.rb index 1e0b6608..737e97c5 100644 --- a/spec/tasks/init_spec.rb +++ b/spec/tasks/init_spec.rb @@ -11,6 +11,6 @@ it 'doesnt create deploy rb if already exists' do allow(File).to receive(:exist?).and_return(false) - expect { subject.invoke }.to raise_error(SystemExit) + expect { subject.invoke }.to raise_error(SystemExit).and output(/You already have/).to_stdout end end From 9b99560a832d7227461f298512a37b8507067492 Mon Sep 17 00:00:00 2001 From: Lovro Bikic Date: Sat, 14 Aug 2021 09:45:35 +0200 Subject: [PATCH 3/3] Suppress spec output --- spec/lib/mina/commands_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/mina/commands_spec.rb b/spec/lib/mina/commands_spec.rb index c16f3b5a..1a481056 100644 --- a/spec/lib/mina/commands_spec.rb +++ b/spec/lib/mina/commands_spec.rb @@ -82,7 +82,7 @@ end describe '#run' do - it 'calls run on a backend' do + it 'calls run on a backend', :suppressed_output do commands.command('ls -al') runner = double(:runner) allow(Mina::Runner).to receive(:new).and_return(runner)