def runner_content(binding)
runner_erb = %q{
<%= jruby_gem %>
<%= dependencies.inspect %>.each { |dep| $CLASSPATH << dep }
<%= runner.gems.inspect %>.each { |ary| JRuby.gem(*ary.flatten) }
<%= runner.requires.inspect %>.each { |rb| Kernel.require rb }
<% if runner.output == false %>
output = StringIO.new
<% elsif runner.output.kind_of?(String) %>
output = File.open(<%= result.output.inspect %>, 'w')
<% else %>
output = STDOUT
<% end %>
parser = ::RSpec::Core::Parser.new
argv = <%= runner.rspec.inspect %> || []
argv.push *<%= tests.inspect %>
Buildr::TestFramework::TestResult::Error.guard('<%= runner.result %>') do
::RSpec::Core::CommandLine.new(argv).run(output, output)
end
exit 0 # let buildr figure the result from the yaml file
}
Filter::Mapper.new(:erb, binding).transform(runner_erb)
end