Sha256: 3926d305793059bc4c3a95e796e17bf2e8b3cd2dc63647a5a41b0dc21a9747ba

Contents?: true

Size: 995 Bytes

Versions: 188

Compression:

Stored size: 995 Bytes

Contents

require 'minitest/autorun'
require_relative 'scrabble_score'

class ScrabbleTest < Minitest::Test
  def test_empty_word_scores_zero
    assert_equal 0, Scrabble.new('').score
  end

  def test_whitespace_scores_zero
    skip
    assert_equal 0, Scrabble.new(" \t\n").score
  end

  def test_nil_scores_zero
    skip
    assert_equal 0, Scrabble.new(nil).score
  end

  def test_scores_very_short_word
    skip
    assert_equal 1, Scrabble.new('a').score
  end

  def test_scores_other_very_short_word
    skip
    assert_equal 4, Scrabble.new('f').score
  end

  def test_simple_word_scores_the_number_of_letters
    skip
    assert_equal 6, Scrabble.new('street').score
  end

  def test_complicated_word_scores_more
    skip
    assert_equal 22, Scrabble.new('quirky').score
  end

  def test_scores_are_case_insensitive
    skip
    assert_equal 41, Scrabble.new('OXYPHENBUTAZONE').score
  end

  def test_convenient_scoring
    skip
    assert_equal 13, Scrabble.score('alacrity')
  end
end

Version data entries

188 entries across 188 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.179 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.178 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.177 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.176 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.175 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.174 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.173 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.172 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.171 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.170 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.169 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.167 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.166 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.165 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.164 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.163 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.162 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.161 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.2.1.160 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb