class TestHtml

Public Instance Methods

test_ingredients_html_generation() click to toggle source
# File test/test_html.rb, line 6
def test_ingredients_html_generation
  
  tb = TableCloth::Recipe.new

  assert_equal "", tb.ingredients.to_html
  
  tb.parse_ingredients "1 cup of sugar"
  
  html = tb.ingredients.to_html
  assert_equal(html, "<ul><li>1 cup of sugar</li></ul>")

  html = tb.ingredients.to_html :class => "mikey"
  assert_equal(html, "<ul class = 'mikey'><li>1 cup of sugar</li></ul>")

  html = tb.ingredients.to_html :id => "mikey"
  assert_equal(html, "<ul id = 'mikey'><li>1 cup of sugar</li></ul>")


  html = tb.ingredients.to_html :id => "mikey", :class => "hogarth"
  assert_equal(html, "<ul id = 'mikey' class = 'hogarth'><li>1 cup of sugar</li></ul>")


end