From 535623b73a86825ba167c17b29f90a07b4de5e7e Mon Sep 17 00:00:00 2001 From: KOTP Date: Wed, 20 Mar 2024 15:51:30 -0400 Subject: [PATCH] Newer assertions for type checks --- exercises/concept/amusement-park/attendee_test.rb | 2 +- .../boutique_inventory_test.rb | 4 ++-- exercises/practice/clock/clock_test.rb | 4 ++-- .../practice/simple-linked-list/simple_linked_list_test.rb | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exercises/concept/amusement-park/attendee_test.rb b/exercises/concept/amusement-park/attendee_test.rb index d6232d2070..61d411d558 100644 --- a/exercises/concept/amusement-park/attendee_test.rb +++ b/exercises/concept/amusement-park/attendee_test.rb @@ -4,7 +4,7 @@ class AttendeeTest < Minitest::Test def test_new_instance height = 100 - assert_equal Attendee, Attendee.new(height).class + assert_instance_of Attendee, Attendee.new(height) end def test_new_instance_height diff --git a/exercises/concept/boutique-inventory-improvements/boutique_inventory_test.rb b/exercises/concept/boutique-inventory-improvements/boutique_inventory_test.rb index a049ef7870..dca9d2a78c 100644 --- a/exercises/concept/boutique-inventory-improvements/boutique_inventory_test.rb +++ b/exercises/concept/boutique-inventory-improvements/boutique_inventory_test.rb @@ -48,7 +48,7 @@ def test_items_is_an_array_of_ostruct coat = { price: 65.00, name: "Coat", quantity_by_size: { m: 1, l: 2 } } handkerchief = { price: 19.99, name: "Handkerchief", quantity_by_size: { s: 3, m: 2 } } items = [shoes, coat, handkerchief] - assert_equal Array, BoutiqueInventory.new(items).items.class - assert_equal OpenStruct, BoutiqueInventory.new(items).items.first.class + assert_instance_of Array, BoutiqueInventory.new(items).items + assert_instance_of OpenStruct, BoutiqueInventory.new(items).items.first end end diff --git a/exercises/practice/clock/clock_test.rb b/exercises/practice/clock/clock_test.rb index 9659d6e46d..92bbff02d5 100644 --- a/exercises/practice/clock/clock_test.rb +++ b/exercises/practice/clock/clock_test.rb @@ -209,14 +209,14 @@ def test_clocks_a_minute_apart skip clock1 = Clock.new(hour: 15, minute: 36) clock2 = Clock.new(hour: 15, minute: 37) - refute clock1 == clock2 + refute_equal clock1, clock2 end def test_clocks_an_hour_apart skip clock1 = Clock.new(hour: 14, minute: 37) clock2 = Clock.new(hour: 15, minute: 37) - refute clock1 == clock2 + refute_equal clock1, clock2 end def test_clocks_with_hour_overflow diff --git a/exercises/practice/simple-linked-list/simple_linked_list_test.rb b/exercises/practice/simple-linked-list/simple_linked_list_test.rb index 301b787084..eb07b74895 100644 --- a/exercises/practice/simple-linked-list/simple_linked_list_test.rb +++ b/exercises/practice/simple-linked-list/simple_linked_list_test.rb @@ -92,7 +92,7 @@ def test_list_created_from_array_still_made_up_of_elements skip array = [1, 2, 3] list = SimpleLinkedList.new(array) - assert_equal Element, list.pop.class + assert_instance_of Element, list.pop end def test_list_from_array_still_acts_as_lifo