Sha256: b7248a420db36114603e57650748cb000428d6787a5cc5a996a845e0f66080bd

Contents?: true

Size: 573 Bytes

Versions: 4

Compression:

Stored size: 573 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Function, '.extract_value' do
  subject { object.extract_value(operand, tuple) }

  let(:header) { Relation::Header.new([ [ :id, Integer ] ]) }
  let(:tuple)  { Tuple.new(header, [ 1 ])                   }
  let(:object) { described_class                            }

  context 'when the operand responds to #call' do
    let(:operand) { header[:id] }

    it { should == 1 }
  end

  context 'when the operand does not respond to #call' do
    let(:operand) { mock('Value') }

    it { should equal(operand) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritas-0.0.7 spec/unit/veritas/function/class_methods/extract_value_spec.rb
veritas-0.0.6 spec/unit/veritas/function/class_methods/extract_value_spec.rb
veritas-0.0.5 spec/unit/veritas/function/class_methods/extract_value_spec.rb
veritas-0.0.4 spec/unit/veritas/function/class_methods/extract_value_spec.rb