Skip to content

Commit

Permalink
Merge pull request collectiveidea#540 from tiegz/spec_deps
Browse files Browse the repository at this point in the history
Update some rspec methods that warn of deprecations.
  • Loading branch information
albus522 committed Jul 10, 2013
2 parents fa22baa + 0a2ccda commit 91a07b2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/delayed/backend/shared_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def create_job(opts = {})
end

it "uses the max_retries value on the payload when defined" do
@job.payload_object.stub!(:max_attempts).and_return(99)
@job.payload_object.stub(:max_attempts).and_return(99)
expect(@job.max_attempts).to eq(99)
end
end
Expand Down Expand Up @@ -504,8 +504,8 @@ def create_job(opts = {})

it "does not fail when the triggered error doesn't have a message" do
error_with_nil_message = StandardError.new
error_with_nil_message.stub!(:message).and_return nil
@job.stub!(:invoke_job).and_raise error_with_nil_message
error_with_nil_message.stub(:message).and_return nil
@job.stub(:invoke_job).and_raise error_with_nil_message
expect{worker.run(@job)}.not_to raise_error
end
end
Expand Down Expand Up @@ -548,7 +548,7 @@ def create_job(opts = {})
it "does not try to run that hook" do
expect {
Delayed::Worker.max_attempts.times { worker.reschedule(@job) }
}.not_to raise_exception(NoMethodError)
}.not_to raise_exception
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lifecycle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
let(:lifecycle) { Delayed::Lifecycle.new }
let(:callback) { lambda {|*args|} }
let(:arguments) { [1] }
let(:behavior) { mock(Object, :before! => nil, :after! => nil, :inside! => nil) }
let(:behavior) { double(Object, :before! => nil, :after! => nil, :inside! => nil) }
let(:wrapped_block) { Proc.new { behavior.inside! } }

describe "before callbacks" do
Expand Down
4 changes: 2 additions & 2 deletions spec/performable_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def signup(email)
describe Delayed::PerformableMailer do
describe "perform" do
it "calls the method and #deliver on the mailer" do
email = mock('email', :deliver => true)
mailer_class = mock('MailerClass', :signup => email)
email = double('email', :deliver => true)
mailer_class = double('MailerClass', :signup => email)
mailer = Delayed::PerformableMailer.new(mailer_class, :signup, ['john@example.com'])

mailer_class.should_receive(:signup).with('john@example.com')
Expand Down
2 changes: 1 addition & 1 deletion spec/performable_method_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def private_method
end
expect {
Delayed::PerformableMethod.new(clazz.new, :private_method, [])
}.not_to raise_error(NoMethodError)
}.not_to raise_error
end

describe "hooks" do
Expand Down
2 changes: 1 addition & 1 deletion spec/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
describe "job_say" do
before do
@worker = Delayed::Worker.new
@job = stub('job', :id => 123, :name => 'ExampleJob')
@job = double('job', :id => 123, :name => 'ExampleJob')
end

it "logs with job name and id" do
Expand Down

0 comments on commit 91a07b2

Please sign in to comment.