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 Phantomjs in Rspec #43

Open
snoblenet opened this issue Nov 10, 2014 · 1 comment
Open

How to stub Phantomjs in Rspec #43

snoblenet opened this issue Nov 10, 2014 · 1 comment

Comments

@snoblenet
Copy link

I'm using Phantomjs to generate Google Charts and convert them to SVG on the server side.

I'm trying to stub this like this:

Phantomjs.stub(:run).and_return("<svg></svg>".html_safe)

But I get:

undefined method `stub' for Phantomjs:Module

Your thoughts?

Thanks,

Steven.

@cschramm
Copy link

From your syntax, you seem to be using RSpec. RSpec 2 defines the stub method on BasicObject. Phantomjs is definitely a BasicObject, so I don't think this is specific. Try stubbing a method of BasicObject. It will probably fails which means your setup of rspec-mocks is insufficient.

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

2 participants