Sha256: 4fc4cf8ea1dfe7e308cf771c7f0b0274332cf287d3144323533e5f73bd5af13c

Contents?: true

Size: 855 Bytes

Versions: 4

Compression:

Stored size: 855 Bytes

Contents

# encoding: utf-8

require 'spec_helper'
require File.expand_path('../fixtures/classes', __FILE__)

describe Function::Binary, '#call' do
  subject { object.call(tuple) }

  let(:described_class) { BinarySpecs::Object                               }
  let(:header)          { Relation::Header.new([ [ :id, Integer ] ])        }
  let(:left)            { Function::Predicate::Equality.new(header[:id], 1) }
  let(:right)           { Function::Predicate::Equality.new(header[:id], 2) }
  let(:tuple)           { Tuple.new(header, [ 1 ])                          }
  let(:response)        { mock('#call response')                            }
  let(:object)          { described_class.new(left, right)                  }

  before do
    described_class.should_receive(:call).with(true, false).and_return(response)
  end

  it { should equal(response) }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritas-0.0.7 spec/unit/veritas/function/binary/call_spec.rb
veritas-0.0.6 spec/unit/veritas/function/binary/call_spec.rb
veritas-0.0.5 spec/unit/veritas/function/binary/call_spec.rb
veritas-0.0.4 spec/unit/veritas/function/binary/call_spec.rb