class TestCurrentWord

Constants

ROOT

Public Instance Methods

setup() click to toggle source
# File test/test_current_word.rb, line 13
def setup
  @word = CW::CurrentWord.new
end
teardown() click to toggle source
# File test/test_current_word.rb, line 17
def teardown
  @word = nil
end
test_clear() click to toggle source
# File test/test_current_word.rb, line 40
def test_clear
  @word.push_letter '.'
  assert_equal '.', @word.to_s
  @word.clear
  assert_equal '', @word.to_s
end
test_current_word() click to toggle source
# File test/test_current_word.rb, line 25
def test_current_word
end
test_initialize() click to toggle source
# File test/test_current_word.rb, line 21
def test_initialize
  assert_equal '', @word.to_s
end
test_process_letter() click to toggle source
# File test/test_current_word.rb, line 54
def test_process_letter
  @word.process_letter 'A'
  assert_equal 'a', @word.to_s
  @word.process_letter 'z'
  assert_equal 'az', @word.to_s
  @word.process_letter ','
  assert_equal 'az,', @word.to_s
end
test_push_letter() click to toggle source
# File test/test_current_word.rb, line 28
def test_push_letter
  @word.push_letter 'a'
  assert_equal 'a', @word.to_s
  @word.push_letter '0'
  assert_equal 'a0', @word.to_s
end
test_strip() click to toggle source
# File test/test_current_word.rb, line 47
def test_strip
  @word.push_letter ' a '
  assert_equal ' a ', @word.to_s
  @word.strip
  assert_equal 'a', @word.to_s
end
test_to_s() click to toggle source
# File test/test_current_word.rb, line 35
def test_to_s
  @word.push_letter '-'
  assert_equal '-', @word.to_s
end