class CatalogConverterCmdTest

Public Instance Methods

test_parse_chaps() click to toggle source
# File ../../../../../test/test_catalog_converter_cmd.rb, line 10
  def test_parse_chaps
    input = <<-EOS
ch01.re
ch02.re
ch03.re
    EOS

    expected = <<-EOS
CHAPS:
  - ch01.re
  - ch02.re
  - ch03.re

    EOS
    assert_equal expected, parse_chaps(input)
  end
test_parse_chaps_empty() click to toggle source
# File ../../../../../test/test_catalog_converter_cmd.rb, line 27
def test_parse_chaps_empty
  assert_equal "CHAPS:\n\n", parse_chaps("")
  assert_equal "CHAPS:\n\n", parse_chaps(nil)
end
test_parse_parts() click to toggle source
# File ../../../../../test/test_catalog_converter_cmd.rb, line 32
  def test_parse_parts
    parts = <<-EOS
pt01
pt02
pt03
    EOS

    chaps = <<-EOS
ch01.re

ch02.re
ch03.re

ch04.re
    EOS

    expected = <<-EOS
CHAPS:
  - pt01:
    - ch01.re
  - pt02:
    - ch02.re
    - ch03.re
  - pt03:
    - ch04.re

    EOS

    assert_equal expected, parse_parts(parts, chaps)
  end
test_parse_parts_chaps_empty() click to toggle source
# File ../../../../../test/test_catalog_converter_cmd.rb, line 63
def test_parse_parts_chaps_empty
  assert_equal "CHAPS:\n\n", parse_parts("", "")
  assert_equal "CHAPS:\n\n", parse_parts(nil, nil)
end
test_parse_postdef() click to toggle source
# File ../../../../../test/test_catalog_converter_cmd.rb, line 68
def test_parse_postdef
  assert_equal "APPENDIX:\n\n", parse_postdef("", true)
  assert_equal "POSTDEF:\n\n", parse_postdef("")
  assert_equal "POSTDEF:\n\n", parse_postdef("", false)
end