Sha256: d1bdc2f75281175f773bdbb9e8e853fea29ae9ef59dc3063ab830816c9fb1b30

Contents?: true

Size: 836 Bytes

Versions: 6

Compression:

Stored size: 836 Bytes

Contents

require 'test_helper'
require 'sup/contact'

module Redwood

class TestContact < Minitest::Test
  def setup
    @contact = ContactManager.init(File.expand_path("../../fixtures/contacts.txt", __FILE__))
    @person  = Person.new "Terrible Name", "terrible@name.com"
  end

  def teardown
    runner = Redwood.const_get "ContactManager".to_sym
    runner.deinstantiate!
  end

  def test_contact_manager
    assert @contact
    ## 1 contact is imported from the fixture file.
    assert_equal 1, @contact.contacts.count
    assert_equal @contact.contact_for("RC").name, "Random Contact"

    assert_nil @contact.contact_for "TN"
    @contact.update_alias @person, "TN"

    assert @contact.is_aliased_contact?(@person)
    assert_equal @person, @contact.contact_for("TN")

    assert_equal "TN", @contact.alias_for(@person)
  end
end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sup-1.2 test/unit/test_contact.rb
sup-1.1 test/unit/test_contact.rb
sup-1.0 test/unit/test_contact.rb
sup-0.23 test/unit/test_contact.rb
sup-0.22.1 test/unit/test_contact.rb
sup-0.22.0 test/unit/test_contact.rb