Skip to content

Commit 1f9b2b0

Browse files
jwfearnchingor13
authored andcommitted
Use assert_nil to fix warnings (#271)
1 parent a42c6fd commit 1f9b2b0

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

test/unit/error_collector_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ def test_can_handle_explicit_null_error_values
156156
assert_equal "1337", error.id
157157

158158
assert_equal({}, error.about, nil)
159-
assert_equal(nil, error.status, nil)
160-
assert_equal(nil, error.code, nil)
161-
assert_equal(nil, error.title, nil)
162-
assert_equal(nil, error.detail, nil)
159+
assert_nil(error.status, nil)
160+
assert_nil(error.code, nil)
161+
assert_nil(error.title, nil)
162+
assert_nil(error.detail, nil)
163163
assert_equal({}, error.source, nil)
164164
assert_equal({}, error.meta.attributes,nil)
165165
end

test/unit/parser_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_can_parse_null_data
5353
article = Article.find(1).first
5454
author = article.author
5555

56-
assert_equal nil, author
56+
assert_nil author
5757
end
5858

5959
end

test/unit/schemable_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def test_defines_defaults
5656
assert_equal 'foo', resource['a']
5757
assert_equal false, resource.b
5858
assert_equal false, resource['b']
59-
assert_equal nil, resource.c
60-
assert_equal nil, resource.d
59+
assert_nil resource.c
60+
assert_nil resource.d
6161
end
6262

6363
def test_find_property_definition
@@ -90,7 +90,7 @@ def test_can_define_multiple_properties
9090

9191
MultipleSchema.schema.each_property do |property|
9292
assert_equal :string, property.type
93-
assert_equal nil, property.default
93+
assert_nil property.default
9494
end
9595
end
9696

test/unit/top_level_links_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def assert_pagination_when_no_next_page
253253
assert_equal 0, articles.offset
254254
assert_equal 1, articles.total_entries
255255
assert_equal 1, articles.limit_value
256-
assert_equal nil, articles.next_page
256+
assert_nil articles.next_page
257257
assert_equal 1, articles.per_page
258258
assert_equal false, articles.out_of_bounds?
259259

0 commit comments

Comments
 (0)