spec/arachni/component/options/enum_spec.rb in arachni-0.4.1.3 vs spec/arachni/component/options/enum_spec.rb in arachni-0.4.2
- old
+ new
@@ -5,46 +5,46 @@
@opt = Arachni::Component::Options::Enum.new( '', [ false, 'Blah', nil, %w(1 2 3)] )
end
describe '#valid?' do
context 'when the value is valid' do
- it 'should return true' do
+ it 'returns true' do
@opt.valid?( '1' ).should be_true
end
end
context 'when the value is not valid' do
- it 'should return false' do
+ it 'returns false' do
@opt.valid?( '4' ).should be_false
end
end
context 'when required but empty' do
- it 'should return false' do
+ it 'returns false' do
@opt.class.new( '', [true] ).valid?( nil ).should be_false
end
end
end
describe '#normalize' do
- it 'should convert the string input into a boolean value' do
+ it 'converts the string input into a boolean value' do
@opt.normalize( '5' ).should be_nil
@opt.normalize( '3' ).should == '3'
@opt.normalize( 3 ).should == '3'
end
end
describe '#desc' do
- it 'should return a description including the acceptable values' do
+ it 'returns a description including the acceptable values' do
@opt.desc.include?( 'Blah' ).should be_true
@opt.enums.each { |v| @opt.desc.include?( v ).should be_true }
@opt.desc = 'boo'
@opt.desc.include?( 'boo' ).should be_true
@opt.desc.include?( 'Blah' ).should be_false
end
end
describe '#type' do
- it 'should return the option type as a string' do
+ it 'returns the option type as a string' do
@opt.type.should == 'enum'
end
end
end