Sha256: 1096c7dd946ebbeb40ea42922b519f8b994f63dba6545f1d44883bdfe672ac63

Contents?: true

Size: 954 Bytes

Versions: 1

Compression:

Stored size: 954 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'anvl/erc'

describe "ERC element" do
  it "should handle basic mapping" do
    h = ANVL::Erc::Element.new :label => 'abc', :value => '123'
    h.to_s.should == "123"
    h.to_anvl.should == "abc: 123"
  end

  it "should support an initial comment to record natural word order" do
    h = ANVL::Erc::Element.new :label => 'abc', :value => ',  van Gogh, Vincent'
    h.to_s.should == "Vincent van Gogh"
    h.to_anvl.should == "abc:,  van Gogh, Vincent"

    h = ANVL::Erc::Element.new :label => 'abc', :value => ',  Howell, III, PhD, 1922-1987, Thurston'
    h.to_s.should == "Thurston Howell, III, PhD, 1922-1987"
    h.to_anvl.should == "abc:,  Howell, III, PhD, 1922-1987, Thurston"

    h = ANVL::Erc::Element.new :label => 'abc', :value => ',  McCartney, Paul, Sir,'
    h.to_s.should == "Sir Paul McCartney"
    h.to_anvl.should == "abc:,  McCartney, Paul, Sir,"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
anvl-0.3.0 spec/element_spec.rb