Sha256: 5a13e27a7ef6075eff8e0b0a0a67e40efa60920af755a5ca43ac5707a93c3c59

Contents?: true

Size: 969 Bytes

Versions: 6

Compression:

Stored size: 969 Bytes

Contents

shared_examples_for 'with_node' do |html|

    let(:with_node) do
        dupped = subject.dup
        dupped.html = html
        dupped
    end

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

        it "includes 'html'" do
            data['html'].should == html
        end
    end

    describe '#node' do
        it 'returns the set node' do
            node = with_node.node
            node.is_a?( Nokogiri::XML::Element ).should be_true
            node.to_s.should == Nokogiri::HTML.fragment( html ).to_s
        end
    end

    describe '#to_h' do
        it "includes 'html'" do
            subject.to_h[:html].should == subject.html
        end
    end

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

        it 'preserves #html' do
            dupped.html.should == with_node.html
        end

        it 'preserves #node' do
            dupped.node.to_s.should == with_node.node.to_s
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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