class CatalogTest

Public Instance Methods

test_appendix() click to toggle source
# File ../../../../../test/test_catalog.rb, line 31
  def test_appendix
    sut = Catalog.new(yaml)
    exp =<<-EOS
post01.re
post02.re
    EOS
    assert_equal(exp.chomp, sut.appendix)
  end
test_chaps() click to toggle source
# File ../../../../../test/test_catalog.rb, line 16
  def test_chaps
    sut = Catalog.new(yaml)
    exp =<<-EOS
ch01.re
ch02.re
    EOS
    assert_equal(exp.chomp, sut.chaps)
  end
test_chaps_empty() click to toggle source
# File ../../../../../test/test_catalog.rb, line 25
def test_chaps_empty
  yaml = StringIO.new
  sut = Catalog.new(yaml)
  assert_equal("", sut.chaps)
end
test_chaps_with_parts() click to toggle source
# File ../../../../../test/test_catalog.rb, line 40
  def test_chaps_with_parts
    sut = Catalog.new(yaml_with_parts)
    exp =<<-EOS
ch01.re
ch02.re
ch03.re
ch04.re
ch05.re
    EOS
    assert_equal(exp.chomp, sut.chaps)
  end
test_from_object() click to toggle source
# File ../../../../../test/test_catalog.rb, line 84
  def test_from_object
    sut = Catalog.new(yaml_hash)
    exp =<<-EOS
ch01.re
ch02.re
    EOS
    assert_equal(exp.chomp, sut.chaps)
  end
test_parts() click to toggle source
# File ../../../../../test/test_catalog.rb, line 52
  def test_parts
    sut = Catalog.new(yaml_with_parts)
    exp =<<-EOS
part1.re
part2.re
    EOS
    assert_equal(exp.chomp, sut.parts)
  end
test_parts2() click to toggle source
# File ../../../../../test/test_catalog.rb, line 66
def test_parts2
  sut = Catalog.new(yaml_with_parts)
  assert_equal(["ch01.re",
                {"part1.re" => ["ch02.re"]},
                "ch03.re",
                {"part2.re" => ["ch04.re", "ch05.re"]}],
               sut.parts_with_chaps)
end
test_parts_with_empty() click to toggle source
# File ../../../../../test/test_catalog.rb, line 61
def test_parts_with_empty
  sut = Catalog.new(yaml)
  assert_equal("", sut.parts)
end
test_postdef() click to toggle source
# File ../../../../../test/test_catalog.rb, line 75
  def test_postdef
    sut = Catalog.new(yaml)
    exp =<<-EOS
back01.re
back02.re
    EOS
    assert_equal(exp.chomp, sut.postdef)
  end
test_predef() click to toggle source
# File ../../../../../test/test_catalog.rb, line 7
  def test_predef
    sut = Catalog.new(yaml)
    exp =<<-EOS
pre01.re
pre02.re
    EOS
    assert_equal(exp.chomp, sut.predef)
  end