Skip to content

Commit 1887f22

Browse files
committed
spec: Support ruby 3.1 and 3.3 error message formats
This message is different for ruby 3.3 and 3.1 Change phrase to be the common factor for both ruby versions
1 parent f865f8b commit 1887f22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: spec/models/mixins/process_tasks_mixin_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,12 @@ def test_method
257257
expect(api_collection).to receive(:find).with(0).and_return(Struct.new(:id).new(0))
258258
expect(api_collection).to receive(:find).with(1).and_return(double("Something that responds", :id => 0, :the_task => nil))
259259

260-
expect($log).to receive(:error).with(a_string_including("undefined method `the_task' for #<struct id=0>")).and_call_original
260+
expect($log).to receive(:error).with(a_string_matching(/undefined method `the_task' for/)).and_call_original
261261
expect(test_class.invoke_api_tasks(api_connection, :ids => [0, 1], :task => "the_task")).to eq([0, 1])
262262
end
263263

264264
it "collection" do
265-
expect($log).to receive(:error).with(a_string_including("undefined method `the_task' for []:Array")).and_call_original
265+
expect($log).to receive(:error).with(a_string_matching(/undefined method `the_task' for/)).and_call_original
266266
expect { test_class.invoke_api_tasks(api_connection, :task => "the_task") }.not_to raise_error
267267
end
268268
end

0 commit comments

Comments
 (0)