Skip to content

Commit

Permalink
Add active_job dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
tawan committed Nov 28, 2015
1 parent ff2f481 commit 6897bfb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
18 changes: 18 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activejob (4.2.5)
activesupport (= 4.2.5)
globalid (>= 0.3.0)
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
aws-sdk-core (2.1.30)
jmespath (~> 1.0)
byebug (5.0.0)
Expand All @@ -18,8 +27,13 @@ GEM
fuubar (2.0.0)
rspec (~> 3.0)
ruby-progressbar (~> 1.4)
globalid (0.3.6)
activesupport (>= 4.1.0)
i18n (0.7.0)
jmespath (1.1.3)
json (1.8.3)
method_source (0.8.2)
minitest (5.8.3)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
Expand All @@ -42,11 +56,15 @@ GEM
rspec-support (3.3.0)
ruby-progressbar (1.7.5)
slop (3.6.0)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
activejob (~> 4.2)
bundler
dotenv
fuubar
Expand Down
4 changes: 3 additions & 1 deletion lib/active_job/queue_adapters/rails_eb_job_adapter.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module ActiveJob
module QueueAdapters
class RailsEbJobAdapter

class << self
attr_writer :aws_client
end
end
end
end
1 change: 1 addition & 0 deletions rails-eb-job.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'pry-byebug'
spec.add_development_dependency 'dotenv'
spec.add_development_dependency 'fuubar'
spec.add_development_dependency 'activejob', '~> 4.2'

spec.add_dependency 'aws-sdk-core', '~> 2'
end
20 changes: 16 additions & 4 deletions spec/active_job/queue_adapters/rails_eb_job_adapter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
require 'spec_helper'
require 'active_job'

class TestJob < ActiveJob::Base
def perform(test_arg)
test_arg
end
end

describe ActiveJob::QueueAdapters::RailsEbJobAdapter do
subject(:adapter) { ActiveJob::QueueAdapters::RailsEbJobAdapter }

let(:aws_client) {
Aws::SQS::Client.new(stub_responses: true, credentials: credentials)
Aws::SQS::Client.new(stub_responses: true)
}
let(:job) { TestJob.new }

before do
aws_client.stub_responses(:get_queue_url, { queue_url: queue_url })
adapter.aws_client = aws_client
end

it "enqueues jobs to Amazon Simple Queue Service queues" do
described_class.enqueue
describe ".enqueue" do
it "sends the serialized job as a message to an AWS SQS queue" do

end
end
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

require 'pry-byebug'
require 'rails_eb_job'

require 'dotenv'
Dotenv.load

Expand Down

0 comments on commit 6897bfb

Please sign in to comment.