File: test_utils.rb

package info (click to toggle)
ruby-tmail 1.2.7.1-3%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,712 kB
  • sloc: ruby: 15,207; ansic: 482; yacc: 349; makefile: 30
file content (36 lines) | stat: -rw-r--r-- 714 bytes parent folder | download | duplicates (2)
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 'test_helper'
require 'tmail'
require 'tmail/utils'

class TestUtils < Test::Unit::TestCase

include TMail::TextUtils

  def _test_new_boundary
    a = new_boundary()
    b = new_boundary()
    c = new_boundary()
    assert_instance_of String, a
    assert_instance_of String, b
    assert_instance_of String, c
    assert(a != b)
    assert(b != c)
    assert(c != a)
  end

  def test_unquote
    mail = TMail::Mail.new
    assert_equal('Hello', mail.unquote('"Hello"'))
  end
  
  def test_unquote_without_quotes
    mail = TMail::Mail.new
    assert_equal('Hello', mail.unquote('Hello'))
  end

  def test_unquote_with_nil
    mail = TMail::Mail.new
    assert_equal(nil, mail.unquote(nil))
  end

end