Sha256: 1279ef38c73b741a00dcb2ff372364c33137a062fb862af8798140428a266bbe

Contents?: true

Size: 909 Bytes

Versions: 21

Compression:

Stored size: 909 Bytes

Contents

describe Moneta::Api::Types::OperationInfo do
  let(:operation_info) { described_class.new }

  describe '#add_attribute' do
    subject {
      operation_info.attribute
      operation_info.add_attribute(item)
      operation_info.attribute
    }

    context 'when item instance of Moneta::Api::Types::KeyValueAttribute' do
      let(:item) { Moneta::Api::Types::KeyValueAttribute.new.fill(key: 'key', value: 'value') }

      its(:count) { is_expected.to eq 1 }
    end

    context 'when wrong item' do
      let(:item) { String.new }

      it { expect{ subject }.to raise_error(TypeError) }
    end
  end

  describe '#get_attribute' do
    before do
      operation_info.add_attribute(Moneta::Api::Types::KeyValueAttribute.new.fill(key: 'key', value: 'value'))
    end

    subject { operation_info.get_attribute('key') }

    it { is_expected.to be_a Moneta::Api::Types::KeyValueAttribute }
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
moneta-api-2.1.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-2.0.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-2.0.0.rc2 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-2.0.0.rc1 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.13.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.8 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.7 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.6 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.5 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.4 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.3 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.2 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.1 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.12.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.11.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.10.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.9.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.8.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.7.0 spec/lib/moneta/api/types/operation_info_spec.rb
moneta-api-1.6.0 spec/lib/moneta/api/types/operation_info_spec.rb