Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
We can re-use the same EC2 client stub response because Aws::EC2::Resource#instances implementation it's just a wrapper around the Aws::EC2::Client#describe_instances method, so the underlying EC2 API call is the same. Snippet code from https://github.com/aws/aws-sdk-ruby:
After clarifying in Part I the differences between Aws::EC2::Client, Aws::EC2::Resource and Resources (e.g. Aws::EC2::Vpc, Aws::EC2::Instance, etc), today we'll see how to add tests while we're using AWS SDK for Ruby. We'll follow the repo pabloxio/ruby_aws_sdk_rspec to understand how to stub responses for the AWS EC2 Client.