Sha256: 58b9cfc6edb7b31b2fc096fe0cc06d7c00f28690206c0e85864e9599497d7865

Contents?: true

Size: 665 Bytes

Versions: 4

Compression:

Stored size: 665 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'
require 'avatar/source/string_substitution_source'

class TestStringSubstitutionSource < Test::Unit::TestCase
  
  def setup
    @source = Avatar::Source::StringSubstitutionSource.new('#{a} and #{b} but not {b}')
  end
  
  def test_avatar_url_nil_for_nil_person
    assert_nil @source.avatar_url_for(nil)
  end
  
  def test_avatar_url_nil_when_not_all_variables_replaced
    assert_nil @source.avatar_url_for(:bar, :b => 'ham')
  end
  
  def test_avatar_url_when_all_variables_replaced
    assert_equal 'green eggs and ham but not {b}', @source.avatar_url_for(:bar, :a => 'green eggs', :b => 'ham')
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
avatar-0.0.2 test/test_string_substitution_source.rb
avatar-0.0.4 test/test_string_substitution_source.rb
avatar-0.0.1 test/test_string_substitution_source.rb
avatar-0.0.3 test/test_string_substitution_source.rb