Sha256: 6d19b9b6a0fde0050c375a5f19caa94a3f9a1aafee5c0d5539167d0f6164fe08

Contents?: true

Size: 949 Bytes

Versions: 163

Compression:

Stored size: 949 Bytes

Contents

#!/usr/bin/env ruby
gem 'minitest', '>= 5.0.0'
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

163 entries across 163 versions & 1 rubygems

Version Path
trackler-2.0.6.27 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.26 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.25 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.24 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.23 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.22 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.21 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.20 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.19 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.18 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.17 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.16 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.15 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.14 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.13 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.12 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.11 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.10 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.9 tracks/ruby/exercises/matrix/matrix_test.rb
trackler-2.0.6.8 tracks/ruby/exercises/matrix/matrix_test.rb