Sha256: 4bca591d601306cdc944a445b44407ff8e03dea1341d676509b64fcdc8d38b9a

Contents?: true

Size: 998 Bytes

Versions: 21

Compression:

Stored size: 998 Bytes

Contents

shared_examples_for 'reporter' do
    include_examples 'component'

    before( :all ) { framework.reporters.load name }
    after( :each ) { File.delete( outfile ) rescue nil }

    def self.test_with_full_report( &block )
        it 'formats a full report' do
            run( full_report )
            instance_eval( &block ) if block_given?
        end
    end

    def self.test_with_empty_report( &block )
        it 'can handle an empty report' do
            run( empty_report )
            instance_eval( &block ) if block_given?
        end
    end

    def run( report )
        reporters[name].new( report, outfile: outfile ).run
    end

    def full_report
        Arachni::Report.load( fixtures_path + '/report.afr' )
    end

    def empty_report
        Arachni::Report.new( options: { url: 'http://test.com' } )
    end

    def outfile
        @outfile ||= "#{Dir.tmpdir}/#{(0..10).map{ rand( 9 ).to_s }.join}"
    end

    def reporters
        framework.reporters
    end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
arachni-1.6.1.3 spec/support/shared/reporter.rb
arachni-1.6.1.2 spec/support/shared/reporter.rb
arachni-1.6.1.1 spec/support/shared/reporter.rb
arachni-1.6.1 spec/support/shared/reporter.rb
arachni-1.6.0 spec/support/shared/reporter.rb
arachni-1.5.1 spec/support/shared/reporter.rb
arachni-1.5 spec/support/shared/reporter.rb
arachni-1.4 spec/support/shared/reporter.rb
arachni-1.3.2 spec/support/shared/reporter.rb
arachni-1.3.1 spec/support/shared/reporter.rb
arachni-1.3 spec/support/shared/reporter.rb
arachni-1.2.1 spec/support/shared/reporter.rb
arachni-1.2 spec/support/shared/reporter.rb
arachni-1.1 spec/support/shared/reporter.rb
arachni-1.0.6 spec/support/shared/reporter.rb
arachni-1.0.5 spec/support/shared/reporter.rb
arachni-1.0.4 spec/support/shared/reporter.rb
arachni-1.0.3 spec/support/shared/reporter.rb
arachni-1.0.2 spec/support/shared/reporter.rb
arachni-1.0.1 spec/support/shared/reporter.rb