Rev | Line | |
---|
[389] | 1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
| 2 | include OpenEHR::AM::Archetype::Assertion
|
---|
| 3 |
|
---|
| 4 | describe ExprUnaryOperator do
|
---|
| 5 | before(:each) do
|
---|
| 6 | operator = OperatorKind.new(:value => 2001)
|
---|
| 7 | operand = stub(ExprItem, :type => 'Real')
|
---|
| 8 | @expr_unary_operator =
|
---|
| 9 | ExprUnaryOperator.new(:type => 'Integer',
|
---|
| 10 | :item => 'ANY',
|
---|
| 11 | :reference_type => 'operator',
|
---|
| 12 | :operator => operator,
|
---|
| 13 | :precedence_overridden => true,
|
---|
| 14 | :operand => operand)
|
---|
| 15 | end
|
---|
| 16 |
|
---|
| 17 | it 'operand shoud be assigned properly' do
|
---|
| 18 | @expr_unary_operator.operand.type.should == 'Real'
|
---|
| 19 | end
|
---|
| 20 |
|
---|
| 21 | it 'should raise ArgumentError when operand is nil' do
|
---|
| 22 | lambda {
|
---|
| 23 | @expr_unary_operator.operand = nil
|
---|
| 24 | }.should raise_error ArgumentError
|
---|
| 25 | end
|
---|
| 26 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.