Sha256: dbd6d78f24e9bcfef5a1c2b5b456415dce63bc4848c6703ea2e1b93772164f24

Contents?: true

Size: 849 Bytes

Versions: 9

Compression:

Stored size: 849 Bytes

Contents

require 'spec_helper'

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

    describe '#valid?' do
        context 'when the path exists' do
            it 'returns true' do
                @opt.valid?( __FILE__ ).should be_true
            end
        end
        context 'when the path does not exist' do
            it 'returns false' do
                @opt.valid?( __FILE__ + '22' ).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 == 'path'
        end
    end

end

Version data entries

9 entries across 9 versions & 1 rubygems

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