source: ruby/branches/0.5/spec/lib/open_ehr/rm/support/identification/party_ref_spec.rb@ 277

Last change on this file since 277 was 277, checked in by KOBAYASHI, Shinji, 15 years ago

party_ref test/unit move to rspec

File size: 842 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../spec_helper'
2include OpenEHR::RM::Support::Identification
3
4describe PartyRef do
5 before(:each) do
6 object_id = stub(ObjectID, :value => 'test')
7 @party_ref = PartyRef.new(:id => object_id,
8 :type => 'PERSON',
9 :namespace => 'test')
10 end
11
12 it 'should be an instance of PartyRef' do
13 @party_ref.should be_an_instance_of PartyRef
14 end
15
16 %w[PERSON ORGANISATION GROUP AGENT ROLE PARTY ACTOR].each do |type|
17 it "should not raise ArgumentError with #{type} type" do
18 lambda {
19 @party_ref.type = type
20 }.should_not raise_error ArgumentError
21 end
22 end
23
24 it 'should raise ArgumentError with UNKNOWN type' do
25 lambda {
26 @party_ref.type = 'UNKNOWN'
27 }.should raise_error ArgumentError
28 end
29end
Note: See TracBrowser for help on using the repository browser.