Sha256: ca623ea1e23ba830469482550d471aca9816d97ba774db95f354ba17643970f8

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

# encoding: utf-8

require 'spec_helper'
require 'veritas/relation/gateway'

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

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

  before do
    Relation::Materialized.stub!(:new).and_return(materialized)
    Relation.stub!(:new).and_return(stub.as_null_object)
  end

  it { should equal(materialized) }

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
veritas-do-adapter-0.0.7 spec/unit/veritas/relation/gateway/materialize_spec.rb
veritas-do-adapter-0.0.6 spec/unit/veritas/relation/gateway/materialize_spec.rb
veritas-do-adapter-0.0.5 spec/unit/veritas/relation/gateway/materialize_spec.rb