Sha256: c1f0201d0c6b70d394113e46c197092f9be1473f9347051554b241931cfd8b1c

Contents?: true

Size: 628 Bytes

Versions: 1

Compression:

Stored size: 628 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

[:call, :[]].each do |method|
  describe Tuple, "##{method}" do
    subject { object.send(method, attribute) }

    let(:header) { Relation::Header.coerce([[:id, Integer]]) }
    let(:object) { described_class.new(header, [1])          }

    context 'with a known attribute' do
      let(:attribute) { header[:id] }

      it { should == 1 }
    end

    context 'with an unknown attribute' do
      let(:attribute) { Attribute::Integer.new(:other_id) }

      specify { expect { subject }.to raise_error(UnknownAttributeError, 'the attribute other_id is unknown') }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.1 spec/unit/axiom/tuple/call_spec.rb