Skip to content

Commit ae6f6c6

Browse files
committed
use assert_nil instead of "assert_equal nil"
1 parent b5d17e0 commit ae6f6c6

6 files changed

Lines changed: 8 additions & 8 deletions

test/test_rake_application_options.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,12 @@ def test_tasks
328328
flags("--tasks", "-T") do |opts|
329329
assert_equal :tasks, opts.show_tasks
330330
assert_equal(//.to_s, opts.show_task_pattern.to_s)
331-
assert_equal nil, opts.show_all_tasks
331+
assert_nil opts.show_all_tasks
332332
end
333333
flags(["--tasks", "xyz"], ["-Txyz"]) do |opts|
334334
assert_equal :tasks, opts.show_tasks
335335
assert_equal(/xyz/.to_s, opts.show_task_pattern.to_s)
336-
assert_equal nil, opts.show_all_tasks
336+
assert_nil opts.show_all_tasks
337337
end
338338
flags(["--tasks", "xyz", "--comments"]) do |opts|
339339
assert_equal :tasks, opts.show_tasks

test/test_rake_file_creation_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_file_needed
2121
FileUtils.rm_rf fc_task.name
2222
assert fc_task.needed?, "file should be needed"
2323
FileUtils.mkdir fc_task.name
24-
assert_equal nil, fc_task.prerequisites.map { |n| Task[n].timestamp }.max
24+
assert_nil fc_task.prerequisites.map { |n| Task[n].timestamp }.max
2525
assert ! fc_task.needed?, "file should not be needed"
2626
end
2727

test/test_rake_file_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_file_need
2828

2929
open(ftask.name, "w") { |f| f.puts "HI" }
3030

31-
assert_equal nil, ftask.prerequisites.map { |n| Task[n].timestamp }.max
31+
assert_nil ftask.prerequisites.map { |n| Task[n].timestamp }.max
3232
assert ! ftask.needed?, "file should not be needed"
3333
ensure
3434
File.delete(ftask.name) rescue nil

test/test_rake_package_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_initialize_noversion
5353

5454
assert_equal "pkg", pkg.package_dir
5555
assert_equal "pkgr", pkg.name
56-
assert_equal nil, pkg.version
56+
assert_nil pkg.version
5757
end
5858

5959
def test_clone

test/test_rake_task.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,13 @@ def test_comments_with_decimal_points
397397

398398
def test_comments_do_not_set
399399
t = task(:t, :name, :rev)
400-
assert_equal nil, t.comment
400+
assert_nil t.comment
401401
end
402402

403403
def test_comments_is_nil
404404
t = task(:t, :name, :rev)
405405
t.comment = nil
406-
assert_equal nil, t.comment
406+
assert_nil t.comment
407407
end
408408

409409
def test_extended_comments

test/test_rake_task_arguments.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_extra_args_with_less_than_named_arguments
142142
assert_equal [:first, :second, :third], ta.names
143143
assert_equal "1", ta[:first]
144144
assert_equal "two", ta[:second]
145-
assert_equal nil, ta[:third]
145+
assert_nil ta[:third]
146146
assert_equal ["1", "two"], ta.to_a
147147
assert_equal [], ta.extras
148148
end

0 commit comments

Comments
 (0)