Module: Template::Test

Defined in:
lib/template-test.rb,
lib/template-test/version.rb

Defined Under Namespace

Classes: Context

Constant Summary collapse

VERSION =
"0.0.3"

Instance Method Summary collapse

Instance Method Details

#html(html, &block) ⇒ Context

Runs the test code in the provided block for the specified rendered HTML.

Examples:




102
103
104
105
106
107
# File 'lib/template-test.rb', line 102

def html(html, &block)
  context = Context.new
  context.html = html
  context.instance_eval &block
  context
end

#template(template_path, &block) ⇒ Context

Runs the test code in the provided block for the specified template.

Examples:




90
91
92
93
94
95
# File 'lib/template-test.rb', line 90

def template(template_path, &block)
  context = Context.new
  context.template_path = template_path
  context.instance_eval &block
  context
end