Sha256: d7c09b0e5c767a2b5b56a9aef63577802b4cf848314ed01ff724ff1959399b74
Contents?: true
Size: 1.06 KB
Versions: 8
Compression:
Stored size: 1.06 KB
Contents
require 'spec_helper' module CMSScanner module Controller # Failure class for testing class SpecFailure < Base def before_scan fail 'error spotted' end end end end describe CMSScanner::Scan do subject(:scanner) { described_class.new } let(:controller) { CMSScanner::Controller } describe '#new, #controllers' do its(:controllers) { should eq([controller::Core.new]) } end describe '#run' do it 'runs the controlllers and calls the formatter#beautify' do expect(scanner.controllers).to receive(:run).ordered expect(scanner.formatter).to receive(:beautify).ordered scanner.run end context 'when an error is raised during the #run' do it 'aborts the scan with the associated output' do scanner.controllers[0] = controller::SpecFailure.new expect(scanner.formatter).to receive(:output) .with('@scan_aborted', hash_including(:reason, :trace, :verbose)) scanner.run end end end describe '#datastore' do its(:datastore) { should eq({}) } end end
Version data entries
8 entries across 8 versions & 1 rubygems