Sha256: f8d4564d9aba67398609af8441bdb2715c7d84280a99c5214f5b3adbfbf647c3

Contents?: true

Size: 1.11 KB

Versions: 19

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'
require 'contacts'

describe Contacts::Contact do
  describe 'instance' do
    before do
      @contact = Contacts::Contact.new('max@example.com', 'Max Power', 'maxpower')
    end
    
    it "should have email" do
      @contact.email.should == 'max@example.com'
    end
    
    it "should have name" do
      @contact.name.should == 'Max Power'
    end
    
    it "should support multiple emails" do
      @contact.emails << 'maxpower@example.com'
      @contact.email.should == 'max@example.com'
      @contact.emails.should == ['max@example.com', 'maxpower@example.com']
    end
    
    it "should have username" do
      @contact.username.should == 'maxpower'
    end
  end
  
  describe '#inspect' do
    it "should be nice" do
      @contact = Contacts::Contact.new('max@example.com', 'Max Power', 'maxpower')
      @contact.inspect.should == '#<Contacts::Contact "Max Power" (max@example.com)>'
    end
    
    it "should be nice without email" do
      @contact = Contacts::Contact.new(nil, 'Max Power', 'maxpower')
      @contact.inspect.should == '#<Contacts::Contact "Max Power">'
    end
  end
  
end

Version data entries

19 entries across 19 versions & 4 rubygems

Version Path
keavy-contacts-0.2.8 spec/contact_spec.rb
keavy-contacts-0.2.9 spec/contact_spec.rb
rakutenusa-contacts-0.2.13 spec/contact_spec.rb
rakutenusa-contacts-0.2.14 spec/contact_spec.rb
rakutenusa-contacts-0.2.15 spec/contact_spec.rb
rakutenusa-contacts-0.2.16 spec/contact_spec.rb
rakutenusa-contacts-0.2.17 spec/contact_spec.rb
rakutenusa-contacts-0.2.18 spec/contact_spec.rb
rakutenusa-contacts-0.2.19 spec/contact_spec.rb
lperichon-contacts-1.0.8 spec/contact_spec.rb
lperichon-contacts-1.0.7 spec/contact_spec.rb
lperichon-contacts-1.0.6 spec/contact_spec.rb
lperichon-contacts-1.0.5 spec/contact_spec.rb
lperichon-contacts-1.0.4 spec/contact_spec.rb
lperichon-contacts-1.0.3 spec/contact_spec.rb
lperichon-contacts-1.0.2 spec/contact_spec.rb
lperichon-contacts-1.0.1 spec/contact_spec.rb
lperichon-contacts-1.0 spec/contact_spec.rb
sundawg_contacts-0.0.1 spec/contact_spec.rb