ruby - In RSpec I want to replace argument to a method call -
ruby - In RSpec I want to replace argument to a method call -
my app using openuri's open()
method, fetch web page.
in spec want able replace url passed in open path of local file.
so when calling open('http://www.google.com')
want switch url /path/to/file
.
is there build-in way in rspec?
i not think rspec provide accomplish this. you're improve off adding parameter method invokes open()
in application. create code reusable.
if application code cannot modified, seek overwrite open()
method substitute parameter in rspec script.
ruby rspec rspec2
Comments
Post a Comment