# File lib/rhc/rest/mock.rb, line 43 def stub_api_request(method, uri, with_auth=true) api = stub_request(method, mock_href(uri, with_auth)) api.with(&lambda{ |r| request.headers['Authorization'] == "Bearer #{with_auth[:token]}" }) if with_auth.respond_to?(:[]) && with_auth[:token] api.with(&expect_authorization(with_auth)) api.with(&user_agent_header) end