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
openehr-1.2.8 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.2.7 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.2.6 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.2.5 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.2.4 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.2.3 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.2.2 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.2.1 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.2.0 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.1.6 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.1.5 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.1.4 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.1.3 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.1.2 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.1.1 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
openehr-1.1.0 spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-1.0.2 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-1.0.1 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-1.0.0 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb
open_ehr-0.9.5 spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb