public
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/Caged/gitnub.git
Click here to lend your support to: gitnub and make a donation at www.pledgie.com !
georgboe (author)
Mon Apr 14 11:51:32 -0700 2008
commit  8371aa6417af86ce08b556b585aa2ef4630d2af8
tree    75a7a2602b3a5a77ef00f912cb7fb2d370330c63
parent  e66ae1df7649d8c340daa0dfea91b193115694ed
gitnub / grit / test / test_actor.rb
100644 36 lines (26 sloc) 0.816 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require File.dirname(__FILE__) + '/helper'
 
class TestActor < Test::Unit::TestCase
  def setup
    
  end
  
  # from_string
  
  def test_from_string_should_separate_name_and_email
    a = Actor.from_string("Tom Werner <tom@example.com>")
    assert_equal "Tom Werner", a.name
    assert_equal "tom@example.com", a.email
  end
  
  def test_from_string_should_handle_just_name
    a = Actor.from_string("Tom Werner")
    assert_equal "Tom Werner", a.name
    assert_equal nil, a.email
  end
  
  # inspect
  
  def test_inspect
    a = Actor.from_string("Tom Werner <tom@example.com>")
    assert_equal %Q{#<Grit::Actor "Tom Werner <tom@example.com>">}, a.inspect
  end
 
  # to_s
 
  def test_to_s_should_alias_name
    a = Actor.from_string("Tom Werner <tom@example.com>")
    assert_equal a.name, a.to_s
  end
end