Sha256: 0b22b2d15bd79adca753f6ff70b74a8e1769445043b89ba2697a9d113f28b50d

Contents?: true

Size: 861 Bytes

Versions: 26

Compression:

Stored size: 861 Bytes

Contents

require File.dirname(__FILE__) + '/../../../../../spec_helper'
include OpenEHR::AM::Archetype::Assertion

describe ExprUnaryOperator do
  before(:each) do
    operator = OperatorKind.new(:value => 2001)
    operand = stub(ExprItem, :type => 'Real')
    @expr_unary_operator =
      ExprUnaryOperator.new(:type => 'Integer',
                            :item => 'ANY',
                            :reference_type => 'operator',
                            :operator => operator,
                            :precedence_overridden => true,
                            :operand => operand)
  end

  it 'operand shoud be assigned properly' do
    @expr_unary_operator.operand.type.should == 'Real'
  end

  it 'should raise ArgumentError when operand is nil' do
    lambda {
      @expr_unary_operator.operand = nil
    }.should raise_error ArgumentError
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
open_ehr-0.9.4 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-0.9.3 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-0.9.2 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-0.9.1 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-0.9.0 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-0.6.1 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb