Sha256: 4336c178e304b3efbfa7e80c611bc511791112a1ab72832f307e6a45b06bb61c

Contents?: true

Size: 874 Bytes

Versions: 9

Compression:

Stored size: 874 Bytes

Contents

require 'spec_helper'

describe Arachni::Component::Options::Address do
    before( :all ) do
        @opt = Arachni::Component::Options::Address
    end

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

    describe '#type' do
        it 'returns the option type as a string' do
            @opt.new( '' ).type.should == 'address'
        end
    end

end

Version data entries

9 entries across 9 versions & 1 rubygems

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