butzopower/clean-rogue

View on GitHub
clean_rogue/lib/clean_rogue_test_support/doubles/fake_game_repo.rb

Summary

Maintainability
A
0 mins
Test Coverage
require "securerandom"

class FakeGameRepo
  def initialize
    @games = {}
  end

  def save(game)
    game.id = SecureRandom.uuid
    @games[game.id] = game
  end

  def find(id)
    @games[id]
  end

  def all
    @games.values
  end
end