Sha256: 1079e477c9db737a940020858bb2651e7a52f979a1b5bf8191b4af18bb821996

Contents?: true

Size: 1015 Bytes

Versions: 45

Compression:

Stored size: 1015 Bytes

Contents

#!/usr/bin/env ruby
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

45 entries across 45 versions & 1 rubygems

Version Path
trackler-2.1.0.32 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.31 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.30 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.29 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.28 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.27 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.26 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.25 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.24 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.23 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.22 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.21 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.20 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.19 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.18 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.17 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.16 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.15 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.14 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb
trackler-2.1.0.13 tracks/ruby/exercises/scrabble-score/scrabble_score_test.rb