spec/reek/cli/application_spec.rb in reek-4.5.4 vs spec/reek/cli/application_spec.rb in reek-4.5.5

- old
+ new

@@ -98,8 +98,32 @@ expect(Reek::CLI::Command::ReportCommand).to have_received(:new). with(sources: expected_sources, configuration: Reek::Configuration::AppConfiguration, options: Reek::CLI::Options) end + + context 'when source files are excluded through configuration' do + let(:app) { described_class.new ['--config', 'some_file.reek', '.'] } + + before do + allow(Reek::Configuration::AppConfiguration). + to receive(:from_path). + with(Pathname.new('some_file.reek')). + and_return configuration + end + + it 'uses configuration for excluded paths' do + expected_sources = Reek::Source::SourceLocator. + new(['.'], configuration: configuration).sources + expect(expected_sources).not_to include(path_excluded_in_configuration) + + app.execute + + expect(Reek::CLI::Command::ReportCommand).to have_received(:new). + with(sources: expected_sources, + configuration: configuration, + options: Reek::CLI::Options) + end + end end end end