Sha256: 2aad642ef3168d0e054173a9b2a84872847a6c728a0fc74de62f0a0399901b88

Contents?: true

Size: 1.47 KB

Versions: 10

Compression:

Stored size: 1.47 KB

Contents

require 'spec_helper'

module Seahorse
  module Model
    describe Operation do
      let(:input_hash) do
        {
          'params' => {
            'body1' => { 'type' => 'string' },
            'body2' => { 'type' => 'string', 'location' => 'body' },
            'body3' => { 'type' => 'string', 'location' => 'body' },
            'uri1' => { 'type' => 'string', 'location' => 'uri' },
            'uri2' => { 'type' => 'string', 'location' => 'uri' },
            'header1' => { 'type' => 'string', 'location' => 'header' }
          },
          'raw_payload' => true
        }
      end

      let(:input) { OperationInput.from_hash(input_hash) }

      describe 'from_hash' do
        it 'loads from a hash' do
          params = input.params
          expect(params.values.map(&:class).uniq).to eq [Shapes::StringShape]
          expect(input.raw_payload).to eq true
        end

        it 'serializes to a hash' do
          expect(input.to_hash).to eq(input_hash)
        end
      end

      describe '#body_params' do
        it 'loads all body parameters' do
          expect(input.body_params.keys).to eq [:body1, :body2, :body3]
        end
      end

      describe '#uri_params' do
        it 'loads all URI parameters' do
          expect(input.uri_params.keys).to eq [:uri1, :uri2]
        end
      end

      describe '#header_params' do
        it 'loads all header parameters' do
          expect(input.header_params.keys).to eq [:header1]
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
aws-sdk-core-2.0.0.rc10 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc9 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc8 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc7 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc6 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc5 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc4 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc3 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc2 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb
aws-sdk-core-2.0.0.rc1 vendor/seahorse/spec/seahorse/model/operation_input_spec.rb