test/signore/cli_test.rb in signore-0.4.2 vs test/signore/cli_test.rb in signore-0.5.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'pathname' require 'stringio' require 'tempfile' require 'tmpdir' require_relative '../test_helper' @@ -34,9 +36,25 @@ out = capture_io { CLI.new(args, repo: repo).run }.first _(out).must_equal <<-end.dedent You do have to be mad to work here, but it doesn’t help. [Gary Barnes, asr] end + end + + it 'tells the user if no signatures are found' do + path = Pathname.new('test/fixtures/nosignatures.yml') + repo = Repo.new(path: path) + args = %w(prego) + out = capture_io { CLI.new(args, repo: repo).run }.first + _(out).must_include 'No signatures found.' + end + + it 'tells the user if no signatures with selected tag are found' do + path = Pathname.new('test/fixtures/signatures.yml') + repo = Repo.new(path: path) + args = %w(prego esse ~percipi) + out = capture_io { CLI.new(args, repo: repo).run }.first + _(out).must_include 'Sadly no signatures are tagged esse ~percipi.' end end describe 'pronto' do let(:repo) { Repo.new(path: Pathname.new(Tempfile.new('').path)) }