Sha256: c2fb5c703e32a091aa88ed3146f213b6cd2f39c24e2f23e391e267ee59f9fa94

Contents?: true

Size: 922 Bytes

Versions: 45

Compression:

Stored size: 922 Bytes

Contents

#!/usr/bin/env ruby
require 'minitest/autorun'
require_relative 'matrix'

class MatrixTest < Minitest::Test
  def test_extract_a_row
    matrix = Matrix.new("1 2\n10 20")
    assert_equal [1, 2], matrix.rows[0]
  end

  def test_extract_same_row_again
    skip
    matrix = Matrix.new("9 7\n8 6")
    assert_equal [9, 7], matrix.rows[0]
  end

  def test_extract_other_row
    skip
    matrix = Matrix.new("9 8 7\n19 18 17")
    assert_equal [19, 18, 17], matrix.rows[1]
  end

  def test_extract_other_row_again
    skip
    matrix = Matrix.new("1 4 9\n16 25 36")
    assert_equal [16, 25, 36], matrix.rows[1]
  end

  def test_extract_a_column
    skip
    matrix = Matrix.new("1 2 3\n4 5 6\n7 8 9\n 8 7 6")
    assert_equal [1, 4, 7, 8], matrix.columns[0]
  end

  def test_extract_another_column
    skip
    matrix = Matrix.new("89 1903 3\n18 3 1\n9 4 800")
    assert_equal [1903, 3, 4], matrix.columns[1]
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
trackler-2.1.0.53 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.52 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.51 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.50 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.49 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.48 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.47 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.46 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.45 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.44 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.43 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.42 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.41 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.40 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.39 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.38 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.37 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.36 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.34 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.1.0.33 tracks/ruby/exercises/matrix/matrix_test.rb