Index: ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb
===================================================================
--- ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb	(revision 245)
+++ ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb	(revision 246)
@@ -12,4 +12,5 @@
 
           def initialize(args = {})
+            super(args)
             self.normal_range = args[:normal_range]
             self.normal_status = args[:normal_status]
@@ -98,10 +99,8 @@
           attr_reader :value, :symbol, :limits
 
-          def initialize(value, symbol, limits=nil, normal_range=nil,
-                         normal_status = nil, other_reference_ranges=nil)
-            self.value = value
-            self.symbol = symbol
-            self.limits = limits
-            super(normal_range, normal_status, other_reference_ranges)
+          def initialize(args = {})
+            super(args)
+            self.symbol = args[:symbol]
+            self.limits = args[:limits]
           end
 
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordinal_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordinal_spec.rb	(revision 246)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordinal_spec.rb	(revision 246)
@@ -0,0 +1,74 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::DataTypes::Quantity
+include OpenEHR::RM::DataTypes::Text
+include OpenEHR::RM::Support::Identification
+
+describe DvOrdinal do
+  before(:each) do
+    terminology_id = stub(TerminologyId, :value => 'urine:prot')
+    code_phrase = stub(CodePhrase, :terminology_id => terminology_id)
+    symbol = stub(DvCodedText, :code_string => '+',
+                  :defining_code => code_phrase)
+    dv_text = stub(DvText, :value => 'limits')
+    limits = stub(ReferenceRange, :meaning => dv_text)
+    @dv_ordinal = DvOrdinal.new(:value => 1,
+                                :symbol => symbol,
+                                :limits => limits)
+  end
+
+  it 'should be an instance of DvOrdinal' do
+    @dv_ordinal.should be_an_instance_of DvOrdinal
+  end
+
+  it 's value should be equal 1' do
+    @dv_ordinal.value.should be_equal 1
+  end
+
+  it 's symbol should be + code string' do
+    @dv_ordinal.symbol.code_string.should == '+'
+  end
+
+  it 's symbol defining_code should be urine:prot' do
+    @dv_ordinal.symbol.defining_code.terminology_id.value.should ==
+      'urine:prot'
+  end
+
+  it 'should be strictry comperable to other DvOrdinal' do
+    terminology_id = stub(TerminologyId, :value => 'urine:prot')
+    code_phrase = stub(CodePhrase, :terminology_id => terminology_id)
+    symbol = stub(DvCodedText, :defining_code => code_phrase)
+    dv_ordinal = DvOrdinal.new(:value => 2,
+                               :symbol => symbol)
+    @dv_ordinal.is_strictly_comparable_to?(dv_ordinal).should be_true
+  end
+
+  it 's limit.value should be limits' do
+    @dv_ordinal.limits.meaning.value.should == 'limits'
+  end
+
+  it 'should raise error when limits.value is not limitted' do
+    unlimit = stub(DvText, :value => 'unimitted')
+    unlimitted_range = stub(ReferenceRange, :meaning => unlimit)
+    lambda {
+      @dv_ordinal.limits = unlimitted_range
+    }.should raise_error ArgumentError
+  end
+
+  it 'should be comparable' do
+    dv_ordinal = stub(DvOrdinal, :value => 2)
+    @dv_ordinal.should < dv_ordinal
+  end
+
+  it 'is_strictly comparable should be false with other instance' do
+    @dv_ordinal.is_strictly_comparable_to?(stub).should be_false
+  end
+
+  it 'is strictly comparable should be false with other terminology' do
+    terminology_id = stub(Terminology, :value => 'blood pressure')
+    code_phrase = stub(CodePhrase, :terminology_id => terminology_id)
+    symbol = stub(DvCodedText, :defining_code => code_phrase)
+    dv_ordinal = DvOrdinal.new(:value => 3,
+                               :symbol => symbol)
+    @dv_ordinal.is_strictly_comparable_to?(dv_ordinal).should be_false
+  end
+end
