Sha256: 0068a1b9bf85a3cc9699f8762901e7d37e48dbcb12794477de5f08328ca96cb7

Contents?: true

Size: 569 Bytes

Versions: 2

Compression:

Stored size: 569 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:header) { Relation::Header.coerce([[: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) { double('Value') }

    it { should be(operand) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-0.2.0 spec/unit/axiom/function/class_methods/extract_value_spec.rb
axiom-0.1.1 spec/unit/axiom/function/class_methods/extract_value_spec.rb