Sha256: 6950cd5d6b05a8c91642a237103291a78c6eda6e41a75fd4ea20652539863105

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

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

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

    it { should be(object) }
  end

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

    it { should be_instance_of(described_class) }

    it { should == [[id]] }
  end

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

    it { should be_instance_of(described_class) }

    it { should be_empty }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-0.2.0 spec/unit/axiom/relation/keys/project_spec.rb
axiom-0.1.1 spec/unit/axiom/relation/keys/project_spec.rb