Skip to content

Commit

Permalink
Experimental Rubinius and JRuby support
Browse files Browse the repository at this point in the history
  • Loading branch information
cryo28 committed Jan 30, 2016
1 parent e39cf30 commit 8ae2595
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,7 @@ rvm:
- 2.1.4
- 2.2.4
- 2.3.0
- rbx-3.14
env:
global:
- SHOW_SIDEKIQ=true
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -152,6 +152,7 @@ and clean status containers.
* Support for sidekiq 4.1, 4.0, 3.5, 3.4
* Dropped support for sidekiq versions older than 3.3
* Dropped support for ruby 1.9.x, 2.0.x
* Experimental support for Rubinius and JRuby


### 1.0.7
Expand Down
4 changes: 2 additions & 2 deletions spec/client_middleware_spec.rb
Expand Up @@ -5,7 +5,7 @@
describe "cryo28/sidekiq_status#11 regression" do
describe "#call" do
before do
SidekiqStatus::Container.should_receive(:create).with(hash_including('worker' => 'TestWorker1'))
expect(SidekiqStatus::Container).to receive(:create).with(hash_including('worker' => 'TestWorker1'))
end

it "accepts a worker class" do
Expand All @@ -21,7 +21,7 @@
end

it "does not create container for scheduled job" do
SidekiqStatus::Container.should_not_receive(:create)
expect(SidekiqStatus::Container).to_not receive(:create)

subject.call("TestWorker1", { "at" => Time.now }, nil) do
end
Expand Down
2 changes: 1 addition & 1 deletion spec/container_spec.rb
Expand Up @@ -91,7 +91,7 @@ def test_container(container, hash, jid = nil)
end

specify ".create" do
SecureRandom.should_receive(:hex).with(12).and_return(jid)
expect(SecureRandom).to receive(:hex).with(12).and_return(jid)
args = ['arg1', 'arg2', {arg3: 'val3'}]

container = described_class.create('args' => args)
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -25,6 +25,10 @@
require GEM_ROOT.join('spec/dummy/boot.rb')

RSpec.configure do |c|
c.expect_with :rspec do |expectations|
expectations.syntax = [:should, :expect]
end

c.before do
Sidekiq.redis{ |conn| conn.flushdb }
end
Expand Down
4 changes: 2 additions & 2 deletions spec/worker_spec.rb
Expand Up @@ -27,7 +27,7 @@ def some_method(*args); end
let(:worker) { SomeWorker.new }

it "receives jid as parameters, loads container and runs original perform with enqueued args" do
worker.should_receive(:some_method).with(*args)
expect(worker).to receive(:some_method).with(*args)
jid = SomeWorker.perform_async(*args)
worker.perform(jid)
end
Expand All @@ -50,7 +50,7 @@ def some_method(*args); end

it "intercepts failures and set status to 'failed' then re-raises the exception" do
exc = RuntimeError.new('Some error')
worker.stub(:some_method).and_raise(exc)
allow(worker).to receive(:some_method).and_raise(exc)

jid = SomeWorker.perform_async(*args)
expect{ worker.perform(jid) }.to raise_exception{ |error| error.object_id.should == exc.object_id }
Expand Down

0 comments on commit 8ae2595

Please sign in to comment.