require 'assert/factory'
module Factory
extend Assert::Factory
def self.template_root
TEMPLATE_ROOT.to_s
end
def self.template_file(name)
TEMPLATE_ROOT.join(name).to_s
end
def self.basic_erb_rendered(locals)
"
name: #{locals['name']}
\n"\
"local1: #{locals['local1']}
\n"
end
def self.yield_erb_rendered(locals, &content)
"name: #{locals['name']}
\n"\
"local1: #{locals['local1']}
\n"\
"\n"\
" #{content.call}\n"\
"
\n"
end
def self.view_erb_rendered(engine, view_handler, locals)
"name: #{view_handler.name}
\n"\
"local1: #{locals['local1']}
\n"\
"id: #{view_handler.identifier}
\n"\
"logger: #{engine.logger.to_s}
\n"
end
def self.yield_view_erb_rendered(engine, view_handler, locals, &content)
"name: #{view_handler.name}
\n"\
"local1: #{locals['local1']}
\n"\
"id: #{view_handler.identifier}
\n"\
"logger: #{engine.logger.to_s}
\n"\
"\n"\
" #{content.call}\n"\
"
\n"
end
def self.partial_erb_rendered(engine, locals)
"local1: #{locals['local1']}
\n"\
"logger: #{engine.logger.to_s}
\n"
end
def self.yield_partial_erb_rendered(engine, locals, &content)
"local1: #{locals['local1']}
\n"\
"logger: #{engine.logger.to_s}
\n"\
"\n"\
" #{content.call}\n"\
"
\n"
end
def self.partial_with_partial_erb_rendered(engine, locals)
"\n"\
"
local1: #{locals['local1']}
\n"\
"
logger: #{engine.logger.to_s}
\n\n"\
"
No locals!\n\n"\
"
No locals!\n\n"\
"
\n"
end
def self.partial_with_capture_partial_erb_rendered(engine, locals)
"\n"\
"
local1: #{locals['local1']}
\n"\
"
logger: #{engine.logger.to_s}
\n"\
"
\n"\
" \n"\
" some content\n"\
"\n"\
"
\n"\
"
local1: #{locals['local1']}
\n"\
"
logger: #{engine.logger.to_s}
\n"\
"
No locals!\n"\
"
No locals!\n"\
"
\n"
end
def self.compile_erb_rendered(engine)
"compile
\n"\
"2
\n"\
"logger: #{engine.logger.to_s}
\n"
end
end