{"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":8,"created_at":"2015-01-02T00:32:21Z","updated_at":"2015-01-29T19:05:01Z","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/72083683","html_url":"https://github.com/aws/aws-sdk-core-ruby/issues/187#issuecomment-72083683","issue_url":"https://api.github.com/repos/aws/aws-sdk-core-ruby/issues/187","id":72083683,"user":{"login":"trevorrowe","id":27863,"avatar_url":"https://avatars.githubusercontent.com/u/27863?v=3","gravatar_id":"","url":"https://api.github.com/users/trevorrowe","html_url":"https://github.com/trevorrowe","followers_url":"https://api.github.com/users/trevorrowe/followers","following_url":"https://api.github.com/users/trevorrowe/following{/other_user}","gists_url":"https://api.github.com/users/trevorrowe/gists{/gist_id}","starred_url":"https://api.github.com/users/trevorrowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevorrowe/subscriptions","organizations_url":"https://api.github.com/users/trevorrowe/orgs","repos_url":"https://api.github.com/users/trevorrowe/repos","events_url":"https://api.github.com/users/trevorrowe/events{/privacy}","received_events_url":"https://api.github.com/users/trevorrowe/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T19:05:01Z","updated_at":"2015-01-29T19:05:01Z","body":"@ktheory I've updated the blog post with mention of `Aws.config[:stub_responses] = true`. Thanks for the suggestion.\r\n\r\n@jtrost Is is documented in each of the client constructors, and then `Aws.config` is briefly documented as a set of default params applied to each client. Its very non-obvious at this point. Currently I am working on putting together a developer guide that should cover these sort of features. "}}