Sha256: 15b84f14c9c42a512edc8bab1e6bd6908a38015e31d3cdbb7d8d37ff030f3532

Contents?: true

Size: 1.05 KB

Versions: 11

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe Arachni::Component::Options::URL do
    include_examples 'component_option'
    subject { described_class.new( ' ') }

    describe '#normalize' do
        it "returns #{Arachni::URI}" do
            subject.value = 'http://localhost'
            expect(subject.normalize).to eq(Arachni::URI('http://localhost'))
        end
    end

    describe '#valid?' do
        context 'when the value is valid' do
            it 'returns true' do
                subject.value = 'http://localhost'
                expect(subject.valid?).to be_truthy
            end
        end

        context 'when the value is not valid' do
            it 'returns false' do
                ['http://localhost22', 'localhost', 11, '#$#$c3c43', true].each do |value|
                    subject.value = value
                    expect(subject.valid?).to be_falsey
                end
            end
        end
    end

    describe '#type' do
        it 'returns the option type as a string' do
            expect(subject.type).to eq(:url)
        end
    end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
arachni-1.6.1.3 spec/arachni/component/options/url_spec.rb
arachni-1.6.1.2 spec/arachni/component/options/url_spec.rb
arachni-1.6.1.1 spec/arachni/component/options/url_spec.rb
arachni-1.6.1 spec/arachni/component/options/url_spec.rb
arachni-1.6.0 spec/arachni/component/options/url_spec.rb
arachni-1.5.1 spec/arachni/component/options/url_spec.rb
arachni-1.5 spec/arachni/component/options/url_spec.rb
arachni-1.4 spec/arachni/component/options/url_spec.rb
arachni-1.3.2 spec/arachni/component/options/url_spec.rb
arachni-1.3.1 spec/arachni/component/options/url_spec.rb
arachni-1.3 spec/arachni/component/options/url_spec.rb