Sha256: 764a6ea7600c1dc93bd98aa91b2d724f5ab65d64e05bbb4ffa30bc5bef0921d7

Contents?: true

Size: 802 Bytes

Versions: 8

Compression:

Stored size: 802 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

8 entries across 8 versions & 3 rubygems

Version Path
madrox-0.1.1 vendor/grit/test/test_actor.rb
madrox-0.1.0 vendor/grit/test/test_actor.rb
ginst-2009.12.8 vendor/plugins/grit/test/test_actor.rb
ginst-2009.11.24 vendor/plugins/grit/test/test_actor.rb
ginst-2009.11.23 vendor/plugins/grit/test/test_actor.rb
ginst-2.0.1 vendor/plugins/grit/test/test_actor.rb
ginst-2.0.0 vendor/plugins/grit/test/test_actor.rb
grit-2.0.0 test/test_actor.rb