Sha256: 00c11cabb81ed3fe5ec3ba10acfea398e321b6f58a16e2f2f11a7a5d88fca499

Contents?: true

Size: 1.35 KB

Versions: 45

Compression:

Stored size: 1.35 KB

Contents

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

class SecretHandshakeTest < Minitest::Test
  def test_handshake_1_to_wink
    handshake = SecretHandshake.new(1)
    assert_equal ['wink'], handshake.commands
  end

  def test_handshake_10_to_double_blink
    skip
    handshake = SecretHandshake.new(2)
    assert_equal ['double blink'], handshake.commands
  end

  def test_handshake_100_to_close_your_eyes
    skip
    handshake = SecretHandshake.new(4)
    assert_equal ['close your eyes'], handshake.commands
  end

  def test_handshake_1000_to_jump
    skip
    handshake = SecretHandshake.new(8)
    assert_equal ['jump'], handshake.commands
  end

  def test_handshake_11_to_wink_and_double_blink
    skip
    handshake = SecretHandshake.new(3)
    assert_equal ['wink', 'double blink'], handshake.commands
  end

  def test_handshake_10011_to_double_blink_and_wink
    skip
    handshake = SecretHandshake.new(19)
    assert_equal ['double blink', 'wink'], handshake.commands
  end

  def test_handshake_11111_to_double_blink_and_wink
    skip
    handshake = SecretHandshake.new(31)
    expected = ['jump', 'close your eyes', 'double blink', 'wink']
    assert_equal expected, handshake.commands
  end

  def test_invalid_handshake
    skip
    handshake = SecretHandshake.new('piggies')
    assert_equal [], handshake.commands
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

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