-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regression fix for serializing structures for EC2.
Fixes #881.
- Loading branch information
1 parent
db967a5
commit 3d5b9cc
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require 'spec_helper' | ||
|
||
module Aws | ||
module Query | ||
describe EC2ParamBuilder do | ||
|
||
let(:shapes) { ApiHelper.sample_shapes } | ||
|
||
let(:rules) { | ||
shape_map = Api::ShapeMap.new(shapes) | ||
shape_map.shape_ref('shape' => 'StructureShape') | ||
} | ||
|
||
def query(params = {}) | ||
param_list = ParamList.new | ||
EC2ParamBuilder.new(param_list).apply(rules, params) | ||
param_list.map { |param| [param.name, param.value ] }.sort | ||
end | ||
|
||
it 'can serialize structures' do | ||
params = Structure.new(*rules.shape.member_names).new | ||
params.boolean = true | ||
params.integer = 123 | ||
params.string = 'abc' | ||
expect(query(params)).to eq([ | ||
['Boolean', 'true'], | ||
['Integer', '123'], | ||
['String', 'abc'], | ||
]) | ||
end | ||
|
||
end | ||
end | ||
end |