From 3ef3c0952fddbe2b48587f6d08ddf8e2c367dd3d Mon Sep 17 00:00:00 2001 From: Krekoten' Marjan Date: Tue, 19 Oct 2010 12:39:20 +0300 Subject: [PATCH] Rename test_valid_range to assert_valid_range MiniTets treats all /test.*/ methods as test examples. Signed-off-by: Konstantin Haase --- test/static_test.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/static_test.rb b/test/static_test.rb index bd3b5da7..50e3db09 100644 --- a/test/static_test.rb +++ b/test/static_test.rb @@ -91,7 +91,7 @@ class StaticTest < Test::Unit::TestCase assert not_found? end - def test_valid_range(http_range, range, path, file) + def assert_valid_range(http_range, range, path, file) request = Rack::MockRequest.new(@app) response = request.get("/#{File.basename(path)}", 'HTTP_RANGE' => http_range) @@ -113,23 +113,23 @@ class StaticTest < Test::Unit::TestCase assert length > 9000, "The test file #{path} is too short (#{length} bytes) to run these tests" [0..0, 42..88, 1234..1234, 100..9000, 0..(length-1), (length-1)..(length-1)].each do |range| - test_valid_range("bytes=#{range.begin}-#{range.end}", range, path, file) + assert_valid_range("bytes=#{range.begin}-#{range.end}", range, path, file) end [0, 100, length-100, length-1].each do |start| - test_valid_range("bytes=#{start}-", (start..length-1), path, file) + assert_valid_range("bytes=#{start}-", (start..length-1), path, file) end [1, 100, length-100, length-1, length].each do |range_length| - test_valid_range("bytes=-#{range_length}", (length-range_length..length-1), path, file) + assert_valid_range("bytes=-#{range_length}", (length-range_length..length-1), path, file) end # Some valid ranges that exceed the length of the file: - test_valid_range("bytes=100-999999", (100..length-1), path, file) - test_valid_range("bytes=100-#{length}", (100..length-1), path, file) - test_valid_range("bytes=-#{length}", (0..length-1), path, file) - test_valid_range("bytes=-#{length+1}", (0..length-1), path, file) - test_valid_range("bytes=-999999", (0..length-1), path, file) + assert_valid_range("bytes=100-999999", (100..length-1), path, file) + assert_valid_range("bytes=100-#{length}", (100..length-1), path, file) + assert_valid_range("bytes=-#{length}", (0..length-1), path, file) + assert_valid_range("bytes=-#{length+1}", (0..length-1), path, file) + assert_valid_range("bytes=-999999", (0..length-1), path, file) end it 'correctly ignores syntactically invalid range requests' do