Skip to content

Commit 1422a18

Browse files
committed
Replace stub with allow...to receive
1 parent d8d8967 commit 1422a18

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spec/oauth2/access_token_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def assert_initialized_token(target)
132132
it "is true if expires_at is in the past" do
133133
access = AccessToken.new(client, token, :refresh_token => 'abaca', :expires_in => 600)
134134
@now = Time.now + 10800
135-
Time.stub(:now).and_return(@now)
135+
allow(Time).to receive(:now).and_return(@now)
136136
expect(access).to be_expired
137137
end
138138

spec/oauth2/client_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
connection = double('connection')
4343
session = double('session', :to_ary => nil)
4444
builder = double('builder')
45-
connection.stub(:build).and_yield(builder)
46-
Faraday::Connection.stub(:new => connection)
45+
allow(connection).to receive(:build).and_yield(builder)
46+
allow(Faraday::Connection).to receive(:new).and_return(connection)
4747

4848
expect(builder).to receive(:adapter).with(:test)
4949

0 commit comments

Comments
 (0)