{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-core-ruby/issues/187","labels_url":"https://api.github.com/repos/aws/aws-sdk-core-ruby/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-core-ruby/issues/187/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-core-ruby/issues/187/events","html_url":"https://github.com/aws/aws-sdk-core-ruby/issues/187","id":53232807,"number":187,"title":"support response stubbing for all instances of a service client","user":{"login":"kalpitad","id":4335348,"avatar_url":"https://avatars.githubusercontent.com/u/4335348?v=3","gravatar_id":"","url":"https://api.github.com/users/kalpitad","html_url":"https://github.com/kalpitad","followers_url":"https://api.github.com/users/kalpitad/followers","following_url":"https://api.github.com/users/kalpitad/following{/other_user}","gists_url":"https://api.github.com/users/kalpitad/gists{/gist_id}","starred_url":"https://api.github.com/users/kalpitad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalpitad/subscriptions","organizations_url":"https://api.github.com/users/kalpitad/orgs","repos_url":"https://api.github.com/users/kalpitad/repos","events_url":"https://api.github.com/users/kalpitad/events{/privacy}","received_events_url":"https://api.github.com/users/kalpitad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aws/aws-sdk-core-ruby/labels/Feature%20Request","name":"Feature Request","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-02T00:32:21Z","updated_at":"2015-01-27T22:49:59Z","closed_at":null,"body":"This is the follow up issue from our discussion in the comments of this blog post: http://ruby.awsblog.com/post/Tx15V81MLPR8D73/Client-Response-Stubs\r\n\r\nMy goal is to set stub_responses in my *test code* that will impact the DynamoDB calls in my *app code*, when the tests are run.\r\n\r\nMy Rspec test code sets `Aws.config[:dynamodb] = {stub_responses: true}` in a helper file. However, since my code calls `Aws::DynamoDB::Client.new.query` (i.e. I always create new clients), how can my test code call the `stub_responses` method on a client instance that it doesn't have access to? I would like a way to be able to stub responses for *all* instances of a service client (e.g. DynamoDB), so that I can affect the return values of the clients within my app code when the test is running.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-core-ruby/issues/comments/71745178","html_url":"https://github.com/aws/aws-sdk-core-ruby/issues/187#issuecomment-71745178","issue_url":"https://api.github.com/repos/aws/aws-sdk-core-ruby/issues/187","id":71745178,"user":{"login":"ktheory","id":975,"avatar_url":"https://avatars.githubusercontent.com/u/975?v=3","gravatar_id":"","url":"https://api.github.com/users/ktheory","html_url":"https://github.com/ktheory","followers_url":"https://api.github.com/users/ktheory/followers","following_url":"https://api.github.com/users/ktheory/following{/other_user}","gists_url":"https://api.github.com/users/ktheory/gists{/gist_id}","starred_url":"https://api.github.com/users/ktheory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktheory/subscriptions","organizations_url":"https://api.github.com/users/ktheory/orgs","repos_url":"https://api.github.com/users/ktheory/repos","events_url":"https://api.github.com/users/ktheory/events{/privacy}","received_events_url":"https://api.github.com/users/ktheory/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T22:49:59Z","updated_at":"2015-01-27T22:49:59Z","body":"TIL about `Aws.config[:stub_responses] = true`. Yay! :tada: That's exactly what I want in my test helpers.\r\n\r\n(@trevorrowe: would be great if you mentioned that on your [blog post about stubbing](http://ruby.awsblog.com/post/Tx15V81MLPR8D73/Client-Response-Stubs).)\r\n"}}