Rev | Line | |
---|
[385] | 1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
| 2 | include OpenEHR::AM::Archetype::Assertion
|
---|
| 3 |
|
---|
| 4 | describe ExprLeaf do
|
---|
| 5 | before(:each) do
|
---|
| 6 | @expr_leaf = ExprLeaf.new(:type => 'Boolean',
|
---|
| 7 | :item => 'ANY',
|
---|
| 8 | :reference_type => 'DV_TEXT')
|
---|
| 9 | end
|
---|
| 10 |
|
---|
| 11 | it 'should be an instance of ExprLeaf' do
|
---|
| 12 | @expr_leaf.should be_an_instance_of ExprLeaf
|
---|
| 13 | end
|
---|
| 14 |
|
---|
| 15 | it 'item should be assigned properly' do
|
---|
| 16 | @expr_leaf.item.should == 'ANY'
|
---|
| 17 | end
|
---|
| 18 |
|
---|
| 19 | it 'should raise ArgumentError when item is nil' do
|
---|
| 20 | lambda {
|
---|
| 21 | @expr_leaf.item = nil
|
---|
| 22 | }.should raise_error ArgumentError
|
---|
| 23 | end
|
---|
| 24 |
|
---|
| 25 | it 'reference_type should be assigned properly' do
|
---|
| 26 | @expr_leaf.reference_type.should == 'DV_TEXT'
|
---|
| 27 | end
|
---|
| 28 |
|
---|
| 29 | it 'should raise ArgumentError when reference_type is nil' do
|
---|
| 30 | lambda {
|
---|
| 31 | @expr_leaf.reference_type = nil
|
---|
| 32 | }.should raise_error ArgumentError
|
---|
| 33 | end
|
---|
| 34 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.