File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -59,15 +59,12 @@ def site=(value)
59
59
60
60
# The Faraday connection object
61
61
def connection
62
- @connection ||= begin
63
- conn = Faraday . new ( site , options [ :connection_opts ] )
64
- if options [ :connection_build ]
65
- conn . build do |b |
66
- options [ :connection_build ] . call ( b )
62
+ @connection ||=
63
+ Faraday . new ( site , options [ :connection_opts ] ) do |builder |
64
+ if options [ :connection_build ]
65
+ options [ :connection_build ] . call ( builder )
67
66
end
68
67
end
69
- conn
70
- end
71
68
end
72
69
73
70
# The authorize endpoint URL of the OAuth2 provider
Original file line number Diff line number Diff line change 46
46
it 'is able to pass a block to configure the connection' do
47
47
connection = double ( 'connection' )
48
48
builder = double ( 'builder' )
49
- allow ( connection ) . to receive ( :build ) . and_yield ( builder )
49
+ allow ( Faraday ) . to receive ( :new ) . and_yield ( builder )
50
50
allow ( Faraday ::Connection ) . to receive ( :new ) . and_return ( connection )
51
51
52
52
expect ( builder ) . to receive ( :adapter ) . with ( :test )
You can’t perform that action at this time.
0 commit comments