@@ -189,22 +189,6 @@ class ::Contact < User; end
189189 } . should raise_error ( ArgumentError , "+options[:fields]+ entry \" unknown\" does not map to a property in #{ @model } " )
190190 end
191191 end
192-
193- describe 'that is an Array containing an invalid object' do
194- it 'should raise an exception' do
195- lambda {
196- DataMapper ::Query . new ( @repository , @model , @options . update ( :fields => [ 1 ] ) )
197- } . should raise_error ( ArgumentError , '+options[:fields]+ entry 1 of an unsupported object Fixnum' )
198- end
199- end
200-
201- describe 'that is an Array containing an unknown Property' do
202- it 'should raise an exception' do
203- lambda {
204- DataMapper ::Query . new ( @repository , @model , @options . update ( :fields => [ DataMapper ::Property ::String . new ( @model , :unknown ) ] ) )
205- } . should raise_error ( ArgumentError , "+options[:field]+ entry :unknown does not map to a property in #{ @model } " )
206- end
207- end
208192 end
209193
210194 describe 'with a links option' do
@@ -291,14 +275,6 @@ class ::Contact < User; end
291275 } . should raise_error ( ArgumentError , "+options[:links]+ entry \" unknown\" does not map to a relationship in #{ @model } " )
292276 end
293277 end
294-
295- describe 'that is an Array containing an invalid object' do
296- it 'should raise an exception' do
297- lambda {
298- DataMapper ::Query . new ( @repository , @model , @options . update ( :links => [ 1 ] ) )
299- } . should raise_error ( ArgumentError , '+options[:links]+ entry 1 of an unsupported object Fixnum' )
300- end
301- end
302278 end
303279
304280 describe 'with a conditions option' do
@@ -794,37 +770,6 @@ class ::Contact < User; end
794770 } . should raise_error ( ArgumentError , "condition \" unknown.id\" does not map to a property or relationship in #{ @model } " )
795771 end
796772 end
797-
798- describe 'that is a Hash with a Property that does not belong to the model' do
799- before do
800- Object . send ( :remove_const , :Alternate ) if Object . const_defined? ( :Alternate )
801- @alternate_model = DataMapper ::Model . new ( 'Alternate' ) do
802- property :id , DataMapper ::Property ::Serial
803- end
804- end
805-
806- it 'should raise an exception' do
807- lambda {
808- DataMapper ::Query . new ( @repository , @model , @options . update ( :conditions => { @alternate_model . properties [ :id ] => 1 } ) )
809- } . should raise_error ( ArgumentError , "condition :id does not map to a property in #{ @model } , but belongs to #{ @alternate_model } " )
810- end
811- end
812-
813- describe 'that is a Hash with a Query::Operator key that is not for a Property in the model' do
814- it 'should raise an exception' do
815- lambda {
816- DataMapper ::Query . new ( @repository , @model , @options . update ( :conditions => { :unknown . asc => 1 } ) )
817- } . should raise_error ( ArgumentError , 'condition #<DataMapper::Query::Operator @target=:unknown @operator=:asc> used an invalid operator asc' )
818- end
819- end
820-
821- describe 'that is a Hash with a key of a type that is not permitted' do
822- it 'should raise an exception' do
823- lambda {
824- DataMapper ::Query . new ( @repository , @model , @options . update ( :conditions => { 1 => 1 } ) )
825- } . should raise_error ( ArgumentError , 'condition 1 of an unsupported object Fixnum' )
826- end
827- end
828773 end
829774
830775 describe 'with an offset option' do
@@ -1129,30 +1074,6 @@ class ::Contact < User; end
11291074 end
11301075 end
11311076
1132- describe 'that is an Array containing an invalid object' do
1133- it 'should raise an exception' do
1134- lambda {
1135- DataMapper ::Query . new ( @repository , @model , @options . update ( :order => [ 1 ] ) )
1136- } . should raise_error ( ArgumentError , '+options[:order]+ entry 1 of an unsupported object Fixnum' )
1137- end
1138- end
1139-
1140- describe 'that contains a Query::Operator with a target that is not part of the model' do
1141- it 'should raise an exception' do
1142- lambda {
1143- DataMapper ::Query . new ( @repository , @model , @options . update ( :order => [ :unknown . desc ] ) )
1144- } . should raise_error ( ArgumentError , "+options[:order]+ entry :unknown does not map to a property in #{ @model } " )
1145- end
1146- end
1147-
1148- describe 'that contains a Query::Operator with an unknown operator' do
1149- it 'should raise an exception' do
1150- lambda {
1151- DataMapper ::Query . new ( @repository , @model , @options . update ( :order => [ :name . gt ] ) )
1152- } . should raise_error ( ArgumentError , '+options[:order]+ entry #<DataMapper::Query::Operator @target=:name @operator=:gt> used an invalid operator gt' )
1153- end
1154- end
1155-
11561077 describe 'that contains a Symbol that is not for a Property in the model' do
11571078 it 'should raise an exception' do
11581079 lambda {
0 commit comments