Sha256: a0df1e5b0b9e212d1a14276ec84df5adea63dcb2d0a18ddd246955676b3b0fc2

Contents?: true

Size: 925 Bytes

Versions: 7

Compression:

Stored size: 925 Bytes

Contents

shared_examples_for 'with_dom' do |html = nil|

    let(:with_dom) do
        dupped = subject.dup
        dupped.html = html
        # It is lazy-loaded.
        dupped.dom
        dupped
    end

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

        it "includes 'dom'" do
            data['dom'].should == with_dom.dom.to_rpc_data
        end
    end

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

        it "restores 'dom'" do
            restored.dom.should == with_dom.dom
        end
    end

    it "returns #{described_class::DOM}" do
        with_dom.dom.should be_kind_of described_class::DOM
    end

    describe '#dup' do
        let(:dupped) { with_dom.dup }

        it 'preserves #dom' do
            dupped.dom.should == with_dom.dom
        end
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arachni-1.0.6 spec/support/shared/element/capabilities/with_dom.rb
arachni-1.0.5 spec/support/shared/element/capabilities/with_dom.rb
arachni-1.0.4 spec/support/shared/element/capabilities/with_dom.rb
arachni-1.0.3 spec/support/shared/element/capabilities/with_dom.rb
arachni-1.0.2 spec/support/shared/element/capabilities/with_dom.rb
arachni-1.0.1 spec/support/shared/element/capabilities/with_dom.rb
arachni-1.0 spec/support/shared/element/capabilities/with_dom.rb