Skip to content

Commit

Permalink
Merge pull request #156 from coding-bunny/upgrade
Browse files Browse the repository at this point in the history
Adding support for latest ruby and Rails 5
  • Loading branch information
packrat386 authored Jun 21, 2020
2 parents 3c99979 + 89d837a commit 8a8e0ee
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 35 deletions.
17 changes: 8 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
language: ruby
rvm:
- 2.2
- 2.3
- 2.4.1
- 2.5.7
- 2.6.5
- jruby
- rbx-2

gemfile:
- gemfiles/sidekiq52_rails42.gemfile
- gemfiles/sidekiq52_rails52.gemfile
- gemfiles/sidekiq60_rails52.gemfile

script: "bundle exec rspec spec"

before_install:
- gem install bundler
- gem install bundler:1.17.3

matrix:
allow_failures:
- rvm: jruby
- rvm: rbx-2
include:
- rvm: 2.0
gemfile: gemfiles/ruby20.gemfile
- rvm: 2.4
gemfile: gemfiles/sidekiq4.gemfile
6 changes: 0 additions & 6 deletions gemfiles/ruby20.gemfile

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/sidekiq4.gemfile

This file was deleted.

12 changes: 12 additions & 0 deletions gemfiles/sidekiq52_rails42.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source 'https://rubygems.org'

gem 'sidekiq', '~> 5.2.2'
gem 'nokogiri', '~> 1.8.5'
gem 'rspec-core', '~> 3.8'
gem 'activejob', '~> 4.2'
gem 'actionmailer', '~> 4.2'
gem 'activerecord', '~> 4.2'
gem "activemodel", "~> 4.2"
gem "railties", "~> 4.2"

gemspec :path => '../'
12 changes: 12 additions & 0 deletions gemfiles/sidekiq52_rails52.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source 'https://rubygems.org'

gem 'sidekiq', '~> 5.2.2'
gem 'nokogiri', '~> 1.8.5'
gem 'rspec-core', '~> 3.8'
gem 'activejob', '~> 5.2'
gem 'actionmailer', '~> 5.2'
gem 'activerecord', '~> 5.2'
gem "activemodel", "~> 5.2"
gem "railties", "~> 5.2"

gemspec :path => '../'
12 changes: 12 additions & 0 deletions gemfiles/sidekiq60_rails52.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source 'https://rubygems.org'

gem 'sidekiq', '~> 6.0'
gem 'nokogiri', '~> 1.8.5'
gem 'rspec-core', '~> 3.8'
gem 'activejob', '~> 5.2'
gem 'actionmailer', '~> 5.2'
gem 'activerecord', '~> 5.2'
gem "activemodel", "~> 5.2"
gem "railties", "~> 5.2"

gemspec :path => '../'
14 changes: 8 additions & 6 deletions rspec-sidekiq.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ Gem::Specification.new do |s|
s.add_dependency 'rspec-core', '~> 3.0', '>= 3.0.0'
s.add_dependency 'sidekiq', '>= 2.4.0'

s.add_development_dependency 'rspec', '~> 3.0'
s.add_development_dependency 'coveralls', '~> 0.8', '>= 0.8.0'
s.add_development_dependency 'fuubar', '~> 2.0', '>= 2.0.0'
s.add_development_dependency 'activejob', '~> 4.2', '>= 4.0.0'
s.add_development_dependency 'actionmailer', '~> 4.2', '>= 4.0.0'
s.add_development_dependency 'activerecord', '~> 4.2', '>= 4.0.0'
s.add_development_dependency 'rspec'
s.add_development_dependency 'coveralls'
s.add_development_dependency 'fuubar'
s.add_development_dependency 'activejob'
s.add_development_dependency 'actionmailer'
s.add_development_dependency 'activerecord'
s.add_development_dependency 'activemodel'
s.add_development_dependency 'activesupport'


s.files = Dir['.gitattributes'] +
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/sidekiq/matchers/be_unique_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

context "without a uniquing solution" do
it "raises an exception" do
expect{subject.unique_key}.to raise_error
expect{subject.unique_key}.to raise_error RuntimeError, 'No support found for Sidekiq unique jobs'
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion spec/rspec/sidekiq/matchers/have_enqueued_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
let(:tomorrow) { DateTime.now + 1 }
let(:interval) { 3.minutes }
let(:argument_subject) { RSpec::Sidekiq::Matchers::HaveEnqueuedJob.new worker_args }
let(:matcher_subject) { RSpec::Sidekiq::Matchers::HaveEnqueuedJob.new [be_a(String), be_a(Fixnum), true, be_a(Hash)] }
let(:matcher_subject) { RSpec::Sidekiq::Matchers::HaveEnqueuedJob.new [be_a(String), be_a(Integer), true, be_a(Hash)] }
let(:worker) { create_worker }
let(:worker_args) { ['string', 1, true, { key: 'value', bar: :foo, nested: [{hash: true}] }] }
let(:active_job) { create_active_job :mailers }
let(:resource) { TestResource.new }

before(:each) do
GlobalID.app = 'rspec-sidekiq'
worker.perform_async *worker_args
active_job.perform_later 'someResource'
active_job.perform_later(resource)
Expand Down
8 changes: 1 addition & 7 deletions spec/support/test_resource.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
class TestResource
include GlobalID::Identification

attr_reader :global_id

def initialize
@global_id = GlobalID.create(self, { app: 'rspec-sidekiq' })
end

def self.find(id)
end

def id
rand(36**10).to_s 36
@id ||= rand(36**10).to_s 36
end
end

0 comments on commit 8a8e0ee

Please sign in to comment.