Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to stub Screencap in Rspec #14

Open
snoblenet opened this issue Nov 10, 2014 · 0 comments
Open

How to stub Screencap in Rspec #14

snoblenet opened this issue Nov 10, 2014 · 0 comments

Comments

@snoblenet
Copy link

I've tried numerous variations:

require 'screencap'

...and then each of the following:


Screencap.any_instance.stub(:fetch).and_return(File.open("#{Rails.root}/spec/support/stubbed_image.png"))

Fetcher::Screencap.any_instance.stub(:fetch).and_return(File.open("#{Rails.root}/spec/support/stubbed_image.png"))

Screencap.stub(:fetch).and_return(File.open("#{Rails.root}/spec/support/stubbed_image.png"))

Fetcher::Screencap(:fetch).and_return(File.open("#{Rails.root}/spec/support/stubbed_image.png"))

But I get various errors saying the various Rspec stubbing methods I require are not defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant