Sha256: f9aa70af26a03ace2e18478728ae5d86f9e5b049f0e1226880760d56f024a0a5

Contents?: true

Size: 775 Bytes

Versions: 4

Compression:

Stored size: 775 Bytes

Contents

require File.dirname(__FILE__) + "/test_helper"

class TestSimonGame < Test::Unit::TestCase
  attr_reader :game
  def setup
    @game = SimonGame.new
    @game.call_context = mock_call_context
  end
  
  def test_game_executes_say_digits_when_asked_to_say_number
    flexmock(game).should_receive(:random_number).and_return("2")
    mock_call_context.should_receive(:say_digits).once.with('2')
    @game.say_number
  end
  
  
  # Didn't get very far on this
  def xtest_can_play_one_round_and_receive_the_players_score
    flexmock(game).should_receive(:random_number).and_return("2")
    assert_equal(3, 'x')
  end
  
    private
    def mock_call_context
      @mock_call_context ||= flexmock("Mock Call Context")
    end
    
    def stub_random_number
      
    end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
eric-adhearsion-0.7.999 app_generators/ahn/templates/components/simon_game/test/test_simon_game.rb
sant0sk1-adhearsion-0.7.999 app_generators/ahn/templates/components/simon_game/test/test_simon_game.rb
sevenscale-adhearsion-0.7.1000 app_generators/ahn/templates/components/simon_game/test/test_simon_game.rb
sevenscale-adhearsion-0.7.1003 app_generators/ahn/templates/components/simon_game/test/test_simon_game.rb