search for: twitterclient

Displaying 1 result from an estimated 1 matches for "twitterclient".

2013 Jan 29
0
How to stub a class inside a module with Mocha in Ruby?
...... def request_token(options={}) consumer(:secure => true).get_request_token(options) end end The request_token is the method I''m trying to stub. And this is what I''ve done in Sinatra which obviously doesn''t work. before ''/'' do @twitterClient = TwitterOAuth::Client.new(some_params_in_hash) end get ''/login'' do token = @twitterClient.request_token(callback) # do some other checking end And here''s my test it "should login with Twitter and save session" do TwitterOAuth::Client.any_instance....