Sha256: 3afb042759af97b94332c15a3914c77f7f052f41936ae88e940a348c3d9cf939

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

module Owasp
  module Esapi
    module Validator
      describe Email do
        let(:validator) {Owasp::Esapi::Validator::Email.new}
          
        it "should discard invalid email addresses" do
          validator.valid?("this is not an email address").should == false
        end
      
        it "should discard invalid email addresses" do
          validator.valid?("12313.it").should == false
        end
        
        it "should discard invalid email addresses" do
          validator.valid?("thesp0nge_at_owasp_dot_org").should == false
        end
        
        it "should discard invalid email addresses" do
          validator.valid?("thesp0 nge@owasp.org").should == false
        end
          
        it "should discard invalid email addresses" do
          validator.valid?("thesp0nge@owasp..org").should == false
        end
        
        it "should discard invalid email addresses" do
          validator.valid?("thesp0nge@ow asp.org").should == false
        end
        
        it "should validate goot email addresses" do
          validator.valid?("thesp0nge@owasp.org").should == true 
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
owasp-esapi-ruby-0.30.0 spec/owasp_esapi_ruby_email_validator_spec.rb