Hello,
I'm developing a tool using aws-sdk gem v2, and implmenting tests with stubbed API requests.
I'd like to stub response including nil value, like this:
client = Aws::RDS::Client.new
client.describe_db_parameters(db_parameter_group_name: "hoge").parameters[2]
=> #<struct
parameter_name="archive_timeout",
parameter_value="300",
description= "Timeout seconds for archiving",
source="system",
apply_type="dynamic",
data_type="integer",
allowed_values="0-2147483647",
is_modifiable=false,
minimum_engine_version=nil,
apply_method=nil>
However, the actual stubbed response is this:
client = Aws::RDS::Client.new(stub_responses: true)
db_parameters = [
{
parameter_name: "archive_timeout",
parameter_value: "300",
description: "Timeout seconds for archiving",
source: "system",
apply_type: "dynamic",
data_type: "integer",
allowed_values: "0-214748364",
is_modifiable: false,
minimum_engine_version: nil,
apply_method: nil
}
]
client.stub_responses(:describe_db_parameters, db_parameters)
client.describe_db_parameters(db_parameter_group_name: "hoge").parameters[0]
=> #<struct
parameter_name="archive_timeout",
parameter_value="300",
description="Timeout seconds for archiving",
source="system",
apply_type="dynamic",
data_type="integer",
allowed_values="0-214748364",
is_modifiable=false,
minimum_engine_version="String",
apply_method="ApplyMethod">
nil value is converted to another default value by #stub_scalar method.
Is there any way to stub nil-included response?
Thanks.
Hello,
I'm developing a tool using aws-sdk gem v2, and implmenting tests with stubbed API requests.
I'd like to stub response including
nilvalue, like this:However, the actual stubbed response is this:
nilvalue is converted to another default value by#stub_scalarmethod.Is there any way to stub
nil-included response?Thanks.