Sha256: aa77942ec7de339492c0d6efd293df286250b3c1c2e1c5a7c0450f7a6a1ff237

Contents?: true

Size: 770 Bytes

Versions: 6

Compression:

Stored size: 770 Bytes

Contents

require 'helper'

module BibTeX
  class NameParserTest < Minitest::Spec

    describe "parse a number of entries having a 'van' or 'van den' name prefix" do
      before do
        @a = Names.parse('van den Bout, D. E.')
        @b = Names.parse('Van den Bout, D. E.')
      end

      it "should parse 'van den' part starting with lowercase letter" do
        assert_equal(@a[0].to_s, "van den Bout, D. E.")
        assert_equal(@a[0].prefix, "van den")
      end

      it "should parse 'Van den' part starting with uppercase letter" do
        assert_equal(@b[0].to_s, "Van den Bout, D. E.")
        assert_equal(@b[0].prefix, "Van den")
      end

      it "should accept empty strings" do
        assert_equal '', Names.parse("").to_s
      end

    end

  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
bibtex-ruby-4.4.7 test/bibtex/test_name_parser.rb
bibtex-ruby-4.4.6 test/bibtex/test_name_parser.rb
bibtex-ruby-4.4.5 test/bibtex/test_name_parser.rb
bibtex_to_scrapbox-0.2.0 gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_name_parser.rb
bibtex_to_scrapbox-0.1.0 gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_name_parser.rb
bibtex-ruby-4.4.4 test/bibtex/test_name_parser.rb