Sha256: 363af1f3667b8827849007a1b221f08c519144bb8d5a21fd27d0a51e1e205339
Contents?: true
Size: 507 Bytes
Versions: 14
Compression:
Stored size: 507 Bytes
Contents
module Janky module ChatService # Mock chat implementation used in testing environments. class Mock def initialize @rooms = {} end attr_writer :rooms def speak(room_name, message) if !@rooms.values.include?(room_name) raise Error, "Unknown room #{room_name.inspect}" end end def rooms acc = [] @rooms.each do |id, name| acc << Room.new(id, name) end acc end end end end
Version data entries
14 entries across 14 versions & 1 rubygems