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

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -