Sha256: ef8880c28a8ce325ba3f292c915b695f015185d42887b79105a210d3a8cd0fc4

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Function::Unary, '#type' do
  subject { object.type }

  let(:object)          { described_class.new(operand) }
  let(:described_class) { Class.new(Function::Numeric) }

  before do
    described_class.class_eval { include Function::Unary }
  end

  context 'when the operand has a type' do
    let(:operand) { double(type: Types::Integer, frozen?: true) }

    it { should be(Types::Integer) }
  end

  context 'when the operand is a primitive' do
    let(:operand) { 1 }

    it { should be(Types::Integer) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.1 spec/unit/axiom/function/unary/type_spec.rb