Sha256: d2f436b9efed5a6495926a67b34a257b633784db5ae74f12ea2b6cb7c14a3c3e

Contents?: true

Size: 968 Bytes

Versions: 7

Compression:

Stored size: 968 Bytes

Contents

require 'spec_helper'

describe Arachni::Parser::Document do
    let(:options) do
        {}
    end
    subject { Arachni::Parser.parse( html, options ) }
    let(:html) do
        <<-EOHTML
        <html>
            <div id="my-id">
                <!-- My comment -->
                <p class="my-class">
                    <a href="/stuff">Stuff</a>
                </p>

                My text
            </div>
        </html>
        EOHTML
    end

    describe '#name' do
        it 'returns self' do
            expect(subject.name).to be :document
        end
    end

    describe '#to_html' do
        it 'generates HTML code from nodes' do
            html = <<-EOHTML
<!DOCTYPE html>
<html>
  <div id="my-id">
    <!-- My comment -->
    <p class="my-class">
      <a href="/stuff">
        Stuff
      </a>
    </p>
    My text
  </div>
</html>
            EOHTML

            expect(subject.to_html.strip).to eq html.strip
        end
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arachni-1.6.1.3 spec/arachni/parser/document_spec.rb
arachni-1.6.1.2 spec/arachni/parser/document_spec.rb
arachni-1.6.1.1 spec/arachni/parser/document_spec.rb
arachni-1.6.1 spec/arachni/parser/document_spec.rb
arachni-1.6.0 spec/arachni/parser/document_spec.rb
arachni-1.5.1 spec/arachni/parser/document_spec.rb
arachni-1.5 spec/arachni/parser/document_spec.rb