File: extensions_validator_spec.rb

package info (click to toggle)
ruby-valid-email 0.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 280 kB
  • sloc: ruby: 575; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'spec_helper'
require 'valid_email/all_with_extensions'

describe String do

  it { expect("mymail@gmail").to respond_to(:email?) }

  it "is a valid e-mail" do
    expect("mymail@gmail.com".email?).to be_truthy
  end

  it "is not valid when text is not a real e-mail" do
    expect("invalidMail".email?).to be_falsey
  end

  context "when nil" do

    it "is invalid e-mail" do
      expect(nil.email?).to be_falsey
    end

  end

end