Sha256: 67bbbe9bb3f6f47c28f455386eec2ceba707b2ed3c98189dc68637600e60a789

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

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

module ShouldConvert
  def it_should_convert(from, to_hash)
    to = to_hash[:to]    
    it "should convert '#{from}' to '#{to}'" do
      MynaBird.convert(from) == to
    end
  end
end

describe MynaBird do
  extend ShouldConvert

  it_should_convert 'brendan@wistia.com',              :to => 'wistia'
  it_should_convert 'brendan.schwartz@gmail.com',      :to => 'brendan-schwartz'
  it_should_convert 'support@gmail.com',               :to => 'support-at-gmail'
  
  it_should_convert 'brendan....schwartz@gmail.com',   :to => 'brendan-schwartz'
  it_should_convert 'bts@alumni.brown.edu',            :to => 'bts'
  it_should_convert 'claire@megacorp.co.uk',           :to => 'megacorp'
  it_should_convert 'brendan19@aol.com',               :to => 'brendan19'
  it_should_convert 'brendan.@aol.com',                :to => 'brendan'
  it_should_convert '.brendan@aol.com',                :to => 'brendan'
  it_should_convert 'brendan+nospam@aol.com',          :to => 'brendan'
  it_should_convert 'BRENDAN@aol.com',                 :to => 'brendan'
  it_should_convert 'brendan@WISTIA.COM',              :to => 'wistia'
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
myna_bird-0.1.0 spec/myna_bird_spec.rb