Sha256: e08129c2576bbfd2b64f1c42e91059ae0a3e5f34319598e015f5c2d02ed98c36

Contents?: true

Size: 839 Bytes

Versions: 2

Compression:

Stored size: 839 Bytes

Contents

# encoding: utf-8

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

describe Relation::Gateway, '#extend' do
  subject { object.extend(args, &block) }

  let(:adapter)  { mock('Adapter')                         }
  let(:relation) { mock('Relation', :extend => response)   }
  let(:response) { mock('New Relation', :kind_of? => true) }
  let!(:object)  { described_class.new(adapter, relation)  }
  let(:args)     { stub                                    }
  let(:block)    { proc {}                                 }

  it_should_behave_like 'a unary relation method'

  it 'forwards the arguments to relation#extend' do
    relation.should_receive(:extend).with(args)
    subject
  end

  it 'forwards the block to relation#extend' do
    relation.stub!(:extend) { |_args, proc| proc.should equal(block) }
    subject
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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