Sha256: b93821e198c16575405f5fbc74bf1eab7055a2b7189c1b9db4e3647a21a6d8ce

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

require './test/test_helper'

class TestSignalTools < Minitest::Test
  def setup
    @array1 = [1,2,3,4,5,6,7,8,9,10]
  end

  def test_sum_returns_the_correct_sum_of_array_elements
    assert_equal(55, SignalTools::sum(@array1))
  end

  def test_average_returns_the_correct_average_of_array_elements
    assert_equal(5.5, SignalTools::average(@array1))
  end

  def test_truncate_to_shortest_returns_two_arrays_of_equal_size
    array2 = [1,2,3]
    SignalTools::truncate_to_shortest!(@array1, array2)
    assert_equal(@array1.size, array2.size)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
signal_tools-0.3.1 test/test_signal_tools.rb