mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-11-16 19:50:00 +01:00
Add tests for bubble sort
This commit is contained in:
parent
76d3fac587
commit
b440aded06
2 changed files with 18 additions and 4 deletions
|
@ -15,8 +15,11 @@ def bubble_sort(array)
|
|||
|
||||
array
|
||||
end
|
||||
puts 'Enter a list of numbers separated by space'
|
||||
|
||||
list = gets
|
||||
bubble_sort(list)
|
||||
print list
|
||||
if $0 == __FILE__
|
||||
puts 'Enter a list of numbers separated by space'
|
||||
|
||||
list = gets
|
||||
bubble_sort(list)
|
||||
print list
|
||||
end
|
||||
|
|
11
sorting/bubble_sort_test.rb
Normal file
11
sorting/bubble_sort_test.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
require 'minitest/autorun'
|
||||
require_relative './sort_tests'
|
||||
require_relative './bubble_sort'
|
||||
|
||||
class TestBubbleSort < Minitest::Test
|
||||
include SortTests
|
||||
|
||||
def sort(input)
|
||||
bubble_sort(input)
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue