Sha256: 9138951fa6be1cf53022d2ebe4d8c7f666dd34f518dab7314e47599f739bf5f3
Contents?: true
Size: 1.76 KB
Versions: 20
Compression:
Stored size: 1.76 KB
Contents
require_relative '../../spec_helper' require_lib 'reek/report/progress_formatter' RSpec.describe Reek::Report::ProgressFormatter::Dots do let(:sources_count) { 23 } let(:formatter) { described_class.new(sources_count) } describe '#header' do it 'announces the number of files to be inspected' do expect(formatter.header).to eq "Inspecting 23 file(s):\n" end end describe '#progress' do let(:clean_examiner) { instance_double(Reek::Examiner, smelly?: false) } let(:smelly_examiner) { instance_double(Reek::Examiner, smelly?: true) } context 'with colors disabled' do before do Rainbow.enabled = false end it 'returns a dot for clean files' do expect(formatter.progress(clean_examiner)).to eq '.' end it 'returns an S for smelly files' do expect(formatter.progress(smelly_examiner)).to eq 'S' end end end describe '#footer' do it 'returns some blank lines to offset the output' do expect(formatter.footer).to eq "\n\n" end end end RSpec.describe Reek::Report::ProgressFormatter::Quiet do let(:sources_count) { 23 } let(:formatter) { described_class.new(sources_count) } describe '#header' do it 'is quiet' do expect(formatter.header).to eq '' end end describe '#progress' do let(:clean_examiner) { instance_double(Reek::Examiner, smelly?: false) } let(:smelly_examiner) { instance_double(Reek::Examiner, smelly?: true) } it 'is quiet for clean files' do expect(formatter.progress(clean_examiner)).to eq '' end it 'is quiet for smelly files' do expect(formatter.progress(smelly_examiner)).to eq '' end end describe '#footer' do it 'is quiet' do expect(formatter.footer).to eq '' end end end
Version data entries
20 entries across 18 versions & 2 rubygems