1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Cleanup unused variables

This commit is contained in:
Vipul A M 2013-03-14 22:33:53 +05:30
parent 54d6ba06cc
commit ef2c38955e
3 changed files with 7 additions and 7 deletions

View file

@ -60,7 +60,7 @@ module IntegrationHelper
def alive?
3.times { get('/ping') }
true
rescue Errno::ECONNREFUSED, Errno::ECONNRESET, EOFError, SystemCallError, OpenURI::HTTPError, Timeout::Error => error
rescue Errno::ECONNREFUSED, Errno::ECONNRESET, EOFError, SystemCallError, OpenURI::HTTPError, Timeout::Error
false
end

View file

@ -38,7 +38,7 @@ class RequestTest < Test::Unit::TestCase
'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
'rack.input' => StringIO.new('foo=bar')
)
params = Sinatra::Base.new!.send(:indifferent_hash).replace(request.params)
Sinatra::Base.new!.send(:indifferent_hash).replace(request.params)
dumped = Marshal.dump(request.params)
assert_equal 'bar', Marshal.load(dumped)['foo']
end

View file

@ -41,9 +41,9 @@ class StreamingTest < Test::Unit::TestCase
it 'calls the callback after it is done' do
step = 0
final = 0
stream = Stream.new { |o| 10.times { step += 1 }}
stream = Stream.new { 10.times { step += 1 }}
stream.callback { final = step }
stream.each { |str| }
stream.each { }
assert_equal 10, final
end
@ -52,7 +52,7 @@ class StreamingTest < Test::Unit::TestCase
final = 0
stream = Stream.new(Stream, :keep_open) { |o| 10.times { step += 1 } }
stream.callback { final = step }
stream.each { |str| }
stream.each { }
assert_equal 0, final
end
@ -61,7 +61,7 @@ class StreamingTest < Test::Unit::TestCase
stream = Stream.new { }
stream.callback { a = true }
stream.callback { b = true }
stream.each { |str| }
stream.each { }
assert a, 'should trigger first callback'
assert b, 'should trigger second callback'
end
@ -110,7 +110,7 @@ class StreamingTest < Test::Unit::TestCase
it 'does not trigger an infinite loop if you call close in a callback' do
stream = Stream.new { |out| out.callback { out.close }}
stream.each { |str| }
stream.each { }
end
it 'gives access to route specific params' do