source: ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/encapsulated/dv_multimedia_spec.rb @ 241

Last change on this file since 241 was 241, checked in by KOBAYASHI, Shinji, 10 years ago

change test/unit to rspec

File size: 1.5 KB
Line 
1require File.dirname(__FILE__) + '/../../../../../spec_helper'
2include OpenEHR::RM::DataTypes::Encapsulated
3include OpenEHR::RM::DataTypes::Text
4include OpenEHR::RM::DataTypes::Uri
5include OpenEHR::RM::Support::Identification
6
7describe DvMultimedia do
8  before(:each) do
9    media_type = stub(CodePhrase, :code_string => 'text/xml')
10    charset = stub(CodePhrase, :code_string => 'UTF-8')
11    uri = stub(DvUri, :value => 'http://openehr.jp/')
12    data = Array['123412', '123112']
13    @dv_multimedia = DvMultimedia.new(:value => '<xml>test</xml>',
14                                      :media_type => media_type,
15                                      :charset => charset,
16                                      :uri => uri,
17                                      :data => data)
18  end
19
20  it 'should be an instance of DvMultimedia' do
21    @dv_multimedia.should be_an_instance_of DvMultimedia
22  end
23
24  it 's value should be <xml>test</xml>' do
25    @dv_multimedia.value.should == '<xml>test</xml>'
26  end
27
28  it 's media_type should be text/xml' do
29    @dv_multimedia.media_type.code_string.should == 'text/xml'
30  end
31
32  it 's size should be equal 15' do
33    @dv_multimedia.size.should be_equal 15
34  end
35
36  it 's charset should be UTF-8' do
37    @dv_multimedia.charset.code_string.should == 'UTF-8'
38  end
39
40  it 's uri value should be http://openehr.jp/ ' do
41    @dv_multimedia.uri.value.should == 'http://openehr.jp/'
42  end
43
44  it 's data[0] should be 123412' do
45    @dv_multimedia.data[0].should == '123412'
46  end
47end
Note: See TracBrowser for help on using the repository browser.