Sha256: 50944cc7d66348fc765cf911293d1060e59e25bfaf524f67e4443269f9595783

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

# encoding: utf-8

require 'spec_helper'
require 'axiom/relation/gateway'

describe Relation::Gateway, '#materialize' do
  subject { object.materialize }

  let(:header)       { double('Header')                                                                          }
  let(:directions)   { double('Directions')                                                                      }
  let(:adapter)      { double.as_null_object                                                                     }
  let(:relation)     { double('Relation', :header => header, :directions => directions, :materialized? => false) }
  let!(:object)      { described_class.new(adapter, relation)                                                    }
  let(:materialized) { double('Materialized')                                                                    }

  before do
    allow(Relation::Materialized).to receive(:new).and_return(materialized)
    allow(Relation).to receive(:new).and_return(double.as_null_object)
  end

  it { should equal(materialized) }

  it 'initializes the materialized relation with the header, tuples and directions' do
    expect(Relation::Materialized).to receive(:new).with(header, [], directions)
    subject
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-do-adapter-0.2.0 spec/unit/axiom/relation/gateway/materialize_spec.rb