Skip to content

Commit

Permalink
Merge pull request #130 from red56/improve-testing-docs-in-readme
Browse files Browse the repository at this point in the history
Improve testing instructions with tracebacks from template errors.
  • Loading branch information
straydogstudio committed Nov 18, 2019
2 parents e5b969b + a6fe4ef commit 88629d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -248,7 +248,9 @@ RSpec.shared_context 'axlsx' do

# mimics an ActionView::Template class, presenting a 'source' method
# to retrieve the content of the template
axlsx_binding.eval(ActionView::Template::Handlers::AxlsxBuilder.new.call(Struct.new(:source).new(File.read(Rails.root.join(*template_path)))))
filename = Rails.root.join(*template_path).to_s
source = Struct.new(:source).new(File.read(filename))
axlsx_binding.eval(ActionView::Template::Handlers::AxlsxBuilder.new.call(source), filename)
axlsx_binding.local_variable_get(:wb)
end
end
Expand Down

0 comments on commit 88629d7

Please sign in to comment.