Skip to content

Commit 7b5a134

Browse files
committed
Fix Ruby 3 compatibility
Also change tests to check keyword usage in that place
1 parent 39aacb8 commit 7b5a134

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

lib/omniauth/strategies/ebay_oauth.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def environment_urls
6767
def user_info
6868
@user_info ||=
6969
OmniAuth::EbayOauth::UserInfo.new(OmniAuth::EbayOauth::UserInfoRequest
70-
.new(access_token.token, client.options).call)
70+
.new(access_token.token, **client.options).call)
7171
end
7272
end
7373
end

spec/omniauth/strategies/ebay_oauth_spec.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
RSpec.describe OmniAuth::Strategies::EbayOauth do
66
let(:options) { {} }
77

8+
before { subject.setup_phase }
9+
810
subject { described_class.new(nil, options) }
911

1012
describe '#callback_url' do
@@ -16,8 +18,6 @@
1618
end
1719

1820
describe '#options' do
19-
before { subject.setup_phase }
20-
2121
it 'default mode is sandbox' do
2222
expect(subject.options.client_options.user_info_endpoint)
2323
.to eq('https://api.sandbox.ebay.com/ws/api.dll')
@@ -112,15 +112,12 @@
112112
describe '#user_info' do
113113
let(:access_token) { instance_double(OAuth2::AccessToken, token: :token) }
114114
let(:user_info) { instance_double(OmniAuth::EbayOauth::UserInfo) }
115-
let(:request) do
116-
instance_double(OmniAuth::EbayOauth::UserInfoRequest, call: {})
117-
end
118115

119116
before do
120117
expect(subject).to receive(:access_token).and_return(access_token)
121-
expect(OmniAuth::EbayOauth::UserInfoRequest)
122-
.to receive(:new).and_return(request)
123-
expect(OmniAuth::EbayOauth::UserInfo)
118+
allow_any_instance_of(OmniAuth::EbayOauth::UserInfoRequest)
119+
.to receive(:call).and_return({})
120+
allow(OmniAuth::EbayOauth::UserInfo)
124121
.to receive(:new).with({}).and_return(user_info)
125122
end
126123

0 commit comments

Comments
 (0)