New upstream version 0.5.4
Sophie Brun
4 years ago
47 | 47 |
each(&:run)
|
48 | 48 |
end
|
49 | 49 |
ensure
|
50 | |
NS::Browser.instance.hydra.abort
|
|
50 |
# The rescue is there to prevent unfinished requests to raise an error, which would prevent
|
|
51 |
# the reverse_each to run
|
|
52 |
# rubocop:disable Style/RescueModifier
|
|
53 |
NS::Browser.instance.hydra.abort rescue nil
|
|
54 |
# rubocop:enable Style/RescueModifier
|
51 | 55 |
|
52 | 56 |
# Reverse is used here as the app/controllers/core#after_scan finishes the output
|
53 | 57 |
# and must be the last one to be executed. It also guarantee that stats will be output
|
1 | 1 |
|
2 | 2 |
# Version
|
3 | 3 |
module CMSScanner
|
4 | |
VERSION = '0.5.3'
|
|
4 |
VERSION = '0.5.4'
|
5 | 5 |
end
|
113 | 113 |
end
|
114 | 114 |
end
|
115 | 115 |
end
|
|
116 |
|
|
117 |
context 'when an error is raised by abort' do
|
|
118 |
it 'ignores it and runs the after_scan methods of each controller' do
|
|
119 |
spec = controller_mod::Spec.new
|
|
120 |
base = controller_mod::Base.new
|
|
121 |
|
|
122 |
controllers << base << spec
|
|
123 |
|
|
124 |
# Needed otherwise the default_argv is taken from rspec
|
|
125 |
# (@default_argv=["--pattern", "spec/**{,/*/**}/*_spec.rb"]>)
|
|
126 |
expect(controllers.option_parser).to receive(:results).and_return({})
|
|
127 |
|
|
128 |
[base, spec].each { |c| expect(c).to receive(:before_scan).ordered }
|
|
129 |
[base, spec].each { |c| expect(c).to receive(:run).ordered }
|
|
130 |
|
|
131 |
expect_any_instance_of(Typhoeus::Hydra).to receive(:abort).and_raise('Should be Ignored')
|
|
132 |
|
|
133 |
[spec, base].each { |c| expect(c).to receive(:after_scan).ordered }
|
|
134 |
|
|
135 |
controllers.run
|
|
136 |
end
|
|
137 |
end
|
116 | 138 |
end
|
117 | 139 |
|
118 | 140 |
describe '#register_options_files' do
|