Skip to content

Commit f73fae4

Browse files
committed
Newer assertions for type checks
1 parent 6902c2f commit f73fae4

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Diff for: exercises/concept/amusement-park/attendee_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class AttendeeTest < Minitest::Test
55
def test_new_instance
66
height = 100
7-
assert_equal Attendee, Attendee.new(height).class
7+
assert_instance_of Attendee, Attendee.new(height)
88
end
99

1010
def test_new_instance_height

Diff for: exercises/concept/boutique-inventory-improvements/boutique_inventory_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_items_is_an_array_of_ostruct
4848
coat = { price: 65.00, name: "Coat", quantity_by_size: { m: 1, l: 2 } }
4949
handkerchief = { price: 19.99, name: "Handkerchief", quantity_by_size: { s: 3, m: 2 } }
5050
items = [shoes, coat, handkerchief]
51-
assert_equal Array, BoutiqueInventory.new(items).items.class
52-
assert_equal OpenStruct, BoutiqueInventory.new(items).items.first.class
51+
assert_instance_of Array, BoutiqueInventory.new(items).items
52+
assert_instance_of OpenStruct, BoutiqueInventory.new(items).items.first
5353
end
5454
end

Diff for: exercises/practice/clock/clock_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ def test_clocks_a_minute_apart
209209
skip
210210
clock1 = Clock.new(hour: 15, minute: 36)
211211
clock2 = Clock.new(hour: 15, minute: 37)
212-
refute clock1 == clock2
212+
refute_equal clock1, clock2
213213
end
214214

215215
def test_clocks_an_hour_apart
216216
skip
217217
clock1 = Clock.new(hour: 14, minute: 37)
218218
clock2 = Clock.new(hour: 15, minute: 37)
219-
refute clock1 == clock2
219+
refute_equal clock1, clock2
220220
end
221221

222222
def test_clocks_with_hour_overflow

Diff for: exercises/practice/simple-linked-list/simple_linked_list_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_list_created_from_array_still_made_up_of_elements
9292
skip
9393
array = [1, 2, 3]
9494
list = SimpleLinkedList.new(array)
95-
assert_equal Element, list.pop.class
95+
assert_instance_of Element, list.pop
9696
end
9797

9898
def test_list_from_array_still_acts_as_lifo

0 commit comments

Comments
 (0)