From 93aa38c05a1784f8bae444bd234230c2e22ccf3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Bieniek?= Date: Fri, 26 Jan 2024 10:28:05 +0100 Subject: [PATCH] Add spec for `Purge` (#25) --- spec/cli/commands/purge_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/cli/commands/purge_spec.rb b/spec/cli/commands/purge_spec.rb index fdb2f0b..bf7fcf1 100644 --- a/spec/cli/commands/purge_spec.rb +++ b/spec/cli/commands/purge_spec.rb @@ -4,4 +4,18 @@ describe Ronin::Wordlists::CLI::Commands::Purge do include_examples "man_page" + + describe '#run' do + let(:cache_dir) { instance_double('CacheDir') } + + before do + allow(Ronin::Wordlists::CacheDir).to receive(:new).and_return(cache_dir) + end + + it 'must purge all cached wordlists' do + expect(cache_dir).to receive(:purge) + + subject.run + end + end end