Sha256: 5faa88e4d4b4e20b5870dbd618eea23e70b709b9c61c82b454af8376ba6448c7

Contents?: true

Size: 573 Bytes

Versions: 5

Compression:

Stored size: 573 Bytes

Contents

# frozen_string_literal: true

describe SlackRubyBot::Bot do
  let! :command do
    Class.new(SlackRubyBot::Bot) do
      command 'bot_spec' do |client, data, match|
        client.say(channel: data.channel, text: match['expression'])
      end
    end
  end

  def app
    SlackRubyBot::Bot.instance
  end

  it 'registers subclass command' do
    expect(SlackRubyBot::Commands::Base.command_classes).to include command
  end

  it 'sends a message' do
    expect(message: "#{SlackRubyBot.config.user} bot_spec message").to respond_with_slack_message('message')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slack-ruby-bot-0.16.1 spec/slack-ruby-bot/commands/bot_spec.rb
slack-ruby-bot-0.16.0 spec/slack-ruby-bot/commands/bot_spec.rb
slack-ruby-bot-0.15.0 spec/slack-ruby-bot/commands/bot_spec.rb
slack-ruby-bot-0.14.0 spec/slack-ruby-bot/commands/bot_spec.rb
slack-ruby-bot-0.13.0 spec/slack-ruby-bot/commands/bot_spec.rb