Skip to content

Commit

Permalink
Clean up warnings seen with RUBYOPT="-w", fixes sidekiq#2402
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Jun 22, 2015
1 parent bab47b5 commit bcbe9b2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions bin/sidekiq
@@ -1,5 +1,10 @@
#!/usr/bin/env ruby

# Quiet some warnings we see when running in warning mode:
# RUBYOPT=-w bundle exec sidekiq
$TESTING = false
$CELLULOID_DEBUG = false

require_relative '../lib/sidekiq/cli'

begin
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/fetch.rb
Expand Up @@ -83,7 +83,7 @@ def self.reset # testing only
end

def self.done?
@done
defined? @done
end

def self.strategy
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/web_helpers.rb
Expand Up @@ -45,7 +45,7 @@ def add_to_head(&block)
end

def display_custom_head
return unless @head_html
return unless defined?(@head_html)
@head_html.map { |block| capture(&block) }.join
end

Expand Down
1 change: 1 addition & 0 deletions test/helper.rb
@@ -1,3 +1,4 @@
$CELLULOID_DEBUG = false
$TESTING = true
require 'coveralls'
Coveralls.wear! do
Expand Down
2 changes: 1 addition & 1 deletion test/test_retry.rb
Expand Up @@ -354,7 +354,7 @@ def @redis.multi; yield self; end
rescue ::StandardError => e1
begin
raise ::StandardError, 'Error 2'
rescue ::StandardError => e2
rescue ::StandardError => _
raise e1
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_scheduled.rb
Expand Up @@ -98,8 +98,8 @@ def with_sidekiq_option(name, value)
i = 500
intervals = i.times.map{ @poller.send(:random_poll_interval) }

assert intervals.all?{|i| i >= 5}
assert intervals.all?{|i| i <= 15}
assert intervals.all?{|x| x >= 5}
assert intervals.all?{|x| x <= 15}
assert_in_delta 10, intervals.reduce(&:+).to_f / i, 0.5
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_web.rb
Expand Up @@ -292,7 +292,7 @@ def perform(a, b)

get '/queues/default'
assert_equal 200, last_response.status
assert_match /#{msg['args'][2]}/, last_response.body
assert_match(/#{msg['args'][2]}/, last_response.body)
end

it 'calls updatePage() once when polling' do
Expand Down

0 comments on commit bcbe9b2

Please sign in to comment.