diff --git a/spec/faraday_spec.rb b/spec/faraday_spec.rb index 8b603ebbd..25d9d4fa9 100644 --- a/spec/faraday_spec.rb +++ b/spec/faraday_spec.rb @@ -18,10 +18,13 @@ end it 'uses method_missing on Faraday if there is no proxyable method' do - expect { Faraday.this_method_does_not_exist }.to raise_error( - NoMethodError, - "undefined method `this_method_does_not_exist' for Faraday:Module" - ) + expected_message = if RUBY_VERSION >= '3.3' + "undefined method `this_method_does_not_exist' for module Faraday" + else + "undefined method `this_method_does_not_exist' for Faraday:Module" + end + + expect { Faraday.this_method_does_not_exist }.to raise_error(NoMethodError, expected_message) end it 'proxied methods can be accessed' do