Skip to content

Commit

Permalink
Mab: Alias << to text! for Markaby compat
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Jan 14, 2012
1 parent c1e3fd7 commit 73059dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/camping/mab.rb
Expand Up @@ -11,6 +11,8 @@ module Mab
include ::Mab::Mixin::HTML5
include Views
alias << text!
def tag!(*g,&b)
h=g.last
[:href,:action,:src].map{|a|h[a]&&=self/h[a]} if h.is_a?(Hash)
Expand Down
2 changes: 2 additions & 0 deletions test/app_markup.rb
Expand Up @@ -31,6 +31,7 @@ def index
end

def layout
self << '<!DOCTYPE html>'
html do
head do
title "Web Page"
Expand All @@ -44,6 +45,7 @@ def layout
class Markup::Test < TestCase
def test_render
get '/'
assert_body %r{\A<!DOCTYPE html>}
assert_body %r{<h1>Welcome!</h1>}
assert_body %r{<title>Web Page</title>}
end
Expand Down

0 comments on commit 73059dc

Please sign in to comment.