sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/

test/unit/test_person.rb (910B) - raw

      1 require 'test_helper'
      2 require 'sup'
      3 
      4 module Redwood
      5 
      6 class TestPerson < Minitest::Test
      7   def setup
      8     @person = Person.new(+"Thomassen, Bob", +"bob@thomassen.com")
      9     @no_name = Person.new(nil, +"alice@alice.com")
     10   end
     11 
     12   def test_email_must_be_supplied
     13     assert_raises (ArgumentError) { Person.new(+"Alice", nil) }
     14   end
     15 
     16   def test_to_string
     17     assert_equal "Thomassen, Bob <bob@thomassen.com>", "#{@person}"
     18     assert_equal "alice@alice.com", "#{@no_name}"
     19   end
     20 
     21   def test_shortname
     22     assert_equal "Bob", @person.shortname
     23     assert_equal "alice@alice.com", @no_name.shortname
     24   end
     25 
     26   def test_mediumname
     27     assert_equal "Thomassen, Bob", @person.mediumname
     28     assert_equal "alice@alice.com", @no_name.mediumname
     29   end
     30 
     31   def test_fullname
     32     assert_equal "\"Thomassen, Bob\" <bob@thomassen.com>", @person.full_address
     33     assert_equal "alice@alice.com", @no_name.full_address
     34   end
     35 end
     36 
     37 end