Open petems opened 8 years ago
Well this doesn't look like a capybara screenshot issue per se, and seems like an issue with how you are using Sinatra. See https://github.com/sinatra/sinatra/blob/939ce04c1b77d24dd78285ba0836768ad57aff6c/lib/sinatra/base.rb#L1823, root should not be nil.
Also, try this:
$ ruby -e "require 'sinatra'; puts Sinatra::Application.root; exit"
/Users/mattheworiordan/Projects/Ably/demos/sinatra-chat
What happens you try that?
ruby -e "require 'sinatra'; puts Sinatra::Application.root; exit"
/Users/petersouter/projects/gsubular
I also ran into this issue. I think in modular sinatra applications, Sinatra::Application.root
is nil. I was able to work around this with
root = File.expand_path(File.join(File.dirname(__FILE__), "../tmp"))
Capybara::Screenshot.instance_variable_set :@capybara_root, root
Getting this error when trying to run
screenshot_and_save_page
:In Pry, that value is nil for me:
Versions:
Sinatra code:
Spec code: