Runtime assertions for Ruby literal.fun
ruby
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implements `#reverse` in Literal::Array (#297)

Addresses #192

authored by

Salazar and committed by
GitHub
bf5f3ab7 12411f50

+12
+4
lib/literal/array.rb
··· 493 493 self 494 494 end 495 495 496 + def reverse(...) 497 + __with__(@__value__.reverse(...)) 498 + end 499 + 496 500 alias_method :initialize_copy, :replace 497 501 498 502 def rotate(...)
+8
test/array.test.rb
··· 742 742 refute array.include?(4) 743 743 end 744 744 745 + test "#reverse returns a new reversed array" do 746 + array = Literal::Array(Integer).new(1, 2, 3) 747 + 748 + return_value = array.reverse 749 + 750 + assert_equal return_value, Literal::Array(Integer).new(3, 2, 1) 751 + end 752 + 745 753 test "#rotate! rotates the array" do 746 754 array = Literal::Array(Integer).new(1, 2, 3) 747 755