config.google_adapter = Google::Fake.new
config.google_adapter = Google::Api.new(ENV.fetch('GOOGLE_CLIENT_ID'), ENV.fetch('GOOGLE_CLIENT_SECRET'))
documents = Adapter.google.get_documents('_USER TOKEN_')
if documents.success == true
puts 'Here are your documents'
puts documents.data.inspect
else
puts 'Error!'
puts documents.errors.inspect
end
- Possible to use across app test environment just fake adapter and avoid HTTP connection, however need to make sure, that
Api
andFake
adapters are in sync with their interface. - Isolated testing of the real adapter
Api
- Avoid mocking in the tests easier