Sha256: fe9b1f9545ff8b0129f7874e3b68f318010b18494d3cb70c85d7e8238c2584c0

Contents?: true

Size: 1.32 KB

Versions: 11

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'

describe Arachni::Browser::Javascript::TaintTracer::Sink::ExecutionFlow do
    it_should_behave_like 'sink'

    subject { Factory[:execution_flow] }

    %w(data).each do |m|
        it { is_expected.to respond_to m }
        it { is_expected.to respond_to "#{m}=" }
    end

    it "supports #{Arachni::RPC::Serializer}" do
        expect(subject).to eq(Arachni::RPC::Serializer.deep_clone( subject ))
    end

    describe '#to_rpc_data' do
        let(:data) { subject.to_rpc_data }

        %w(data).each do |attribute|
            it "includes '#{attribute}'" do
                expect(data[attribute.to_sym]).to eq(subject.send( attribute ))
            end
        end
    end

    describe '.from_rpc_data' do
        let(:restored) { described_class.from_rpc_data data }
        let(:data) { Arachni::RPC::Serializer.rpc_data( subject ) }

        %w(data).each do |attribute|
            it "restores '#{attribute}'" do
                expect(restored.send( attribute )).to eq(subject.send( attribute ))
            end
        end
    end

    describe '#to_h' do
        it 'returns a hash containing frame data' do
            expect(subject.to_h).to eq(Factory[:execution_flow])
        end

        it 'is aliased to #to_hash' do
            expect(subject.to_h).to eq(subject.to_hash)
        end
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
arachni-1.6.1.3 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.6.1.2 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.6.1.1 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.6.1 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.6.0 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.5.1 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.5 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.4 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.3.2 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.3.1 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb
arachni-1.3 spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb