Sha256: 53e6c2abedb0da49f6c603a53db7128fa8ca1ff07af97e69e675f35abd710f32

Contents?: true

Size: 1.06 KB

Versions: 9

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'

describe Arachni::Component::Options::URL do
    before( :all ) do
        @opt = Arachni::Component::Options::URL.new( ' ')
    end

    describe '#valid?' do
        context 'when the value is valid' do
            it 'returns true' do
                @opt.valid?( 'http://localhost' ).should be_true
            end
        end
        context 'when the value is not valid' do
            it 'returns false' do
                @opt.valid?( 'http://localhost22' ).should be_false
                @opt.valid?( 'localhost' ).should be_false
                @opt.valid?( 11 ).should be_false
                @opt.valid?( '#$#$c3c43' ).should be_false
                @opt.valid?( true ).should be_false
            end
        end
        context 'when required but empty' do
            it 'returns false' do
                @opt.class.new( '', [true] ).valid?( nil ).should be_false
            end
        end
    end

    describe '#type' do
        it 'returns the option type as a string' do
            @opt.type.should == 'url'
        end
    end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
arachni-0.4.7 spec/arachni/component/options/url_spec.rb
arachni-0.4.6 spec/arachni/component/options/url_spec.rb
arachni-0.4.5.2 spec/arachni/component/options/url_spec.rb
arachni-0.4.5.1 spec/arachni/component/options/url_spec.rb
arachni-0.4.5 spec/arachni/component/options/url_spec.rb
arachni-0.4.4 spec/arachni/component/options/url_spec.rb
arachni-0.4.3.2 spec/arachni/component/options/url_spec.rb
arachni-0.4.3.1 spec/arachni/component/options/url_spec.rb
arachni-0.4.3 spec/arachni/component/options/url_spec.rb