Skip to content

Commit c316e9d

Browse files
committed
test(material_csv_ingestor): amended to use minitest's stubbing
1 parent 10e7e32 commit c316e9d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

test/unit/ingestors/material_csv_ingestor_test.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,11 @@ def run
232232
ingestor = Ingestors::MaterialCsvIngestor.new
233233

234234
# Stub a method that will raise an error
235-
def ingestor.get_column(*)
236-
raise CSV::MalformedCSVError.new('test failure', 22)
235+
ingestor.stub(:get_column, -> (*) { raise CSV::MalformedCSVError.new('test failure', 11) }) do
236+
ingestor.read(source.url)
237237
end
238238

239-
ingestor.read(source.url)
240-
241-
assert_includes ingestor.messages.last, 'parse table failed with: test failure'
239+
assert_equal ingestor.messages.last, 'parse table failed with: test failure in line 11.'
242240
end
243241

244242
private

0 commit comments

Comments
 (0)