Sha256: d255c0bc31793a2a054b34a4c33c8ebab401bed4be1b518cc9574cfbdd48c743

Contents?: true

Size: 816 Bytes

Versions: 25

Compression:

Stored size: 816 Bytes

Contents

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

Version data entries

25 entries across 25 versions & 11 rubygems

Version Path
boof-grit-1.1.2 test/test_actor.rb
cho45-grit-0.8.2 test/test_actor.rb
joelmoss-grit-1.1.4 test/test_actor.rb
joelmoss-grit-1.1.5 test/test_actor.rb
joelmoss-grit-1.1.6 test/test_actor.rb
koke-grit-0.8.1 test/test_actor.rb
mojombo-grit-0.8.0 test/test_actor.rb
mojombo-grit-0.8.1 test/test_actor.rb
mojombo-grit-0.9.3 test/test_actor.rb
mojombo-grit-0.9.4 test/test_actor.rb
pjhyett-grit-0.9.11 test/test_actor.rb
pjhyett-grit-0.9.12 test/test_actor.rb
relevance-grit-0.8.1 test/test_actor.rb
relevance-grit-0.8.3 test/test_actor.rb
schacon-grit-0.9.1 test/test_actor.rb
schacon-grit-0.9.3 test/test_actor.rb
schacon-grit-0.9.4 test/test_actor.rb
square-circle-triangle-grit-1.1.3 test/test_actor.rb
square-circle-triangle-grit-1.1.4 test/test_actor.rb
git-trip-0.0.4 vendor/grit/test/test_actor.rb