File: phrase_list_spec.rb

package info (click to toggle)
ruby-mail 2.6.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,092 kB
  • ctags: 1,281
  • sloc: ruby: 43,919; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 632 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
# encoding: utf-8
require 'spec_helper'

describe Mail::PhraseList do

  describe "parsing" do
    it "should parse a phrase list" do
      parse_text  = '"Mikel Lindsaar", "Mikel", you, somewhere'
      doing { Mail::PhraseList.new(parse_text) }.should_not raise_error
    end

    it "should raise an error if the input is useless" do
      parse_text = nil
      doing { Mail::PhraseList.new(parse_text) }.should raise_error
    end

    it "should not raise an error if the input is empty" do
      parse_text  = '""""""""""""""""'
      Mail::PhraseList.new(parse_text).phrases.should eq [parse_text[1...-1]]
    end
  end
end