Sha256: a73607d78f0f1928bd126a3a9e02fed975af24555c01f2b23507fab02ac9c167

Contents?: true

Size: 665 Bytes

Versions: 7

Compression:

Stored size: 665 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Twitch::Bot::CommandHandler do
  it "responds to user_message" do
    expect(described_class.handled_events).to include(:user_message)
  end

  it "responds to a known command" do
    config = Twitch::Bot::Config.new
    client = Twitch::Bot::Client.new(config: config)
    message = Twitch::Bot::Message::UserMessage.new(
      text: "!mycommand test",
      user: "testuser",
    )
    handler = described_class.new(event: message, client: client)
    handler.command_alias("mycommand")
    allow(handler).to receive(:handle_command)

    handler.call

    expect(handler).to have_received(:handle_command)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
twitch-bot-5.0.6 spec/twitch/bot/command_handler_spec.rb
twitch-bot-5.0.5 spec/twitch/bot/command_handler_spec.rb
twitch-bot-5.0.4 spec/twitch/bot/command_handler_spec.rb
twitch-bot-5.0.2 spec/twitch/bot/command_handler_spec.rb
twitch-bot-5.0.1 spec/twitch/bot/command_handler_spec.rb
twitch-bot-5.0.0 spec/twitch/bot/command_handler_spec.rb
twitch-bot-4.1.1 spec/twitch/bot/command_handler_spec.rb