Sha256: 06d633e0edc203465c8ece93dd4508ca989f99f30c1d3364f8565f3e8ac2e47f

Contents?: true

Size: 770 Bytes

Versions: 1

Compression:

Stored size: 770 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Keys, '#extend' do
  subject { object.extend(attributes) }

  let(:object)    { described_class.coerce([ header ]) }
  let(:header)    { []                                 }

  context 'with attributes that do not change the keys' do
    let(:attributes) { [] }

    it { should equal(object) }
  end

  context 'with attributes that change the keys' do
    let(:attributes) { [ :id ] }

    it { should be_instance_of(described_class) }

    it { should == [ attributes ] }
  end

  context 'when the keys are empty' do
    let(:object)     { described_class.new }
    let(:attributes) { [ :id ]             }

    it { should be_instance_of(described_class) }

    it { should == [ attributes ] }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/relation/keys/extend_spec.rb