Sha256: e951882129e48bd3d0d60ed0c27ecf7e0029c86358be8d0054c27bc795c944f6

Contents?: true

Size: 889 Bytes

Versions: 3

Compression:

Stored size: 889 Bytes

Contents

require 'spec_helper'

module GameMachine
  module Commands
    describe ChatCommands do

      let(:actor_ref) {double('Actor::Ref', :tell => true)}

      subject{ChatCommands.new}

      before(:each) do
        allow(GameSystems::ChatManager).to receive(:find).and_return(actor_ref)
      end

      describe "#send_private_message" do
        it "sends a private message request to the chat actor" do
          expect(actor_ref).to receive(:tell)
          subject.send_private_message('1','blah')
        end
      end

      describe "#join" do
        it "joins a chat group" do
          expect(actor_ref).to receive(:tell)
          subject.join('blah','player1')
        end
      end

      describe "#leave" do
        it "leaves a chat group" do
          expect(actor_ref).to receive(:tell)
          subject.leave('blah','player1')
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
game_machine-1.0.4 spec/commands/chat_commands_spec.rb
game_machine-1.0.2 spec/commands/chat_commands_spec.rb
game_machine-0.0.11 spec/commands/chat_commands_spec.rb