Permalink
Browse files

Updated the specs for stubbing

  • Loading branch information...
1 parent 1b20513 commit f84b1e368605525c9ceda99b2ad7b57adfc1f2d0 @davidakachaos davidakachaos committed Jul 17, 2013
@@ -70,7 +70,7 @@
private
def if_there_are_jobs(num)
- Delayed::Mongoid::Job::Mock.scaler.should_receive(:jobs).any_number_of_times.and_return(NumWorkers.new(num))
+ Delayed::Mongoid::Job::Mock.scaler.stub(:jobs).and_return(NumWorkers.new(num))
end
def should_scale_workers_to(num)
@@ -8,13 +8,13 @@
context 'with jobs' do
before do
- Delayed::Workless::Scaler::HerokuCedar.should_receive(:jobs).any_number_of_times.and_return(NumWorkers.new(10))
+ Delayed::Workless::Scaler::HerokuCedar.stub(:jobs).and_return(NumWorkers.new(10))
end
context 'without workers' do
before do
- Delayed::Workless::Scaler::HerokuCedar.should_receive(:workers).and_return(0)
+ Delayed::Workless::Scaler::HerokuCedar.stub(:workers).and_return(0)
end
it 'should set the workers to 1' do
@@ -27,7 +27,7 @@
context 'with workers' do
before do
- Delayed::Workless::Scaler::HerokuCedar.should_receive(:workers).and_return(10)
+ Delayed::Workless::Scaler::HerokuCedar.stub(:workers).and_return(10)
end
it 'should not set anything' do
@@ -42,7 +42,7 @@
context 'with no jobs' do
before do
- Delayed::Workless::Scaler::HerokuCedar.should_receive(:jobs).any_number_of_times.and_return(NumWorkers.new(0))
+ Delayed::Workless::Scaler::HerokuCedar.stub(:jobs).and_return(NumWorkers.new(0))
end
context 'without workers' do
@@ -61,7 +61,7 @@
context 'with workers' do
before do
- Delayed::Workless::Scaler::HerokuCedar.should_receive(:workers).and_return(NumWorkers.new(10))
+ Delayed::Workless::Scaler::HerokuCedar.stub(:workers).and_return(NumWorkers.new(10))
end
it 'should set the workers to 0' do
@@ -5,13 +5,13 @@
context 'with jobs' do
before do
- Delayed::Workless::Scaler::Heroku.should_receive(:jobs).any_number_of_times.and_return(NumWorkers.new(10))
+ Delayed::Workless::Scaler::Heroku.stub(:jobs).and_return(NumWorkers.new(10))
end
context 'without workers' do
before do
- Delayed::Workless::Scaler::Heroku.should_receive(:workers).and_return(0)
+ Delayed::Workless::Scaler::Heroku.stub(:workers).and_return(0)
end
it 'should set the workers to 1' do
@@ -24,7 +24,7 @@
context 'with workers' do
before do
- Delayed::Workless::Scaler::Heroku.should_receive(:workers).and_return(NumWorkers.new(10))
+ Delayed::Workless::Scaler::Heroku.stub(:workers).and_return(NumWorkers.new(10))
end
it 'should not set anything' do
@@ -39,13 +39,13 @@
context 'with no jobs' do
before do
- Delayed::Workless::Scaler::Heroku.should_receive(:jobs).any_number_of_times.and_return(NumWorkers.new(0))
+ Delayed::Workless::Scaler::Heroku.stub(:jobs).and_return(NumWorkers.new(0))
end
context 'without workers' do
before do
- Delayed::Workless::Scaler::Heroku.should_receive(:workers).and_return(0)
+ Delayed::Workless::Scaler::Heroku.stub(:workers).and_return(0)
end
it 'should not set anything' do
@@ -58,7 +58,7 @@
context 'with workers' do
before do
- Delayed::Workless::Scaler::Heroku.should_receive(:workers).and_return(NumWorkers.new(10))
+ Delayed::Workless::Scaler::Heroku.stub(:workers).and_return(NumWorkers.new(10))
end
it 'should set the workers to 0' do

0 comments on commit f84b1e3

Please sign in to comment.