An API wrapper for News API v2
Add this line to your application's Gemfile:
gem 'news_api'
app_image: &app_image | |
working_directory: ~/cryptostatus | |
docker: | |
- image: circleci/ruby:2.4.2-node | |
environment: | |
BUNDLE_JOBS: 3 | |
BUNDLE_RETRY: 3 | |
BUNDLE_PATH: vendor/bundle | |
PGHOST: 127.0.0.1 | |
PG_USERNAME: circleci-postgres |
An API wrapper for News API v2
Add this line to your application's Gemfile:
gem 'news_api'
describe StatisticsJob, job: true do | |
describe '.perform_async' do | |
it 'calls StatisticsService' do | |
expect(StatisticsService).to receive(:call) | |
StatisticsJob.perform_async | |
end | |
end | |
end |
class StatisticsJob | |
include SuckerPunch::Job | |
def perform | |
StatisticsService.call | |
end | |
end |
require 'sucker_punch/testing/inline' |
SuckerPunch.exception_handler = -> (e, klass, args) { Raven.capture_exception(e) } |
MailigJob.perform_in(60, 'value') |
class MailingJob | |
include SuckerPunch::Job | |
workers 5 | |
def perform(event) | |
# do something... | |
end | |
end |
MailingJob.perform_async('value') |
MailingJob.new.perform('value') |