@@ -40,6 +40,11 @@ def test_list_records_scope
4040 assert_equal expected_count , doc . elements [ 'OAI-PMH/ListRecords' ] . to_a . size
4141 end
4242
43+ def test_invalid_set_raises_no_match
44+ assert_raises ( OAI ::NoMatchException ) do
45+ @provider . list_records ( :metadata_prefix => 'oai_dc' , :set => "invalid_does_not_exist" )
46+ end
47+ end
4348
4449 def test_get_record_alternate_identifier_column
4550 @provider = ARProviderCustomIdentifierField . new
@@ -127,7 +132,7 @@ def test_from_and_until
127132 )
128133 assert_equal 40 , doc . elements [ 'OAI-PMH/ListRecords' ] . to_a . size
129134 end
130-
135+
131136 def test_bad_until_raises_exception
132137 DCField . order ( id : :asc ) . limit ( 10 ) . update_all ( updated_at : 1 . year . ago )
133138 DCField . order ( id : :desc ) . limit ( 10 ) . update_all ( updated_at : 1 . year . from_now )
@@ -140,11 +145,11 @@ def test_bad_until_raises_exception
140145 end
141146 end
142147 end
143-
148+
144149 def test_bad_from_raises_exception
145150 DCField . order ( id : :asc ) . limit ( 10 ) . update_all ( updated_at : 1 . year . ago )
146151 DCField . order ( id : :desc ) . limit ( 10 ) . update_all ( updated_at : 1 . year . from_now )
147-
152+
148153 badTimes = [
149154 'junk' ,
150155 'February 92nd, 2015' ]
@@ -169,7 +174,7 @@ def test_handles_empty_collections
169174 REXML ::Document . new ( @provider . list_records ( :metadata_prefix => 'oai_dc' ) )
170175 end
171176 end
172-
177+
173178 def test_bad_id_raises_exception
174179 badIdentifiers = [
175180 'invalid"id' ,
@@ -183,7 +188,7 @@ def test_bad_id_raises_exception
183188 end
184189 end
185190 end
186-
191+
187192
188193 def setup
189194 @provider = ARProvider . new
0 commit comments