Sha256: c68cb6964486549f235ab0c6ad60f2ef8e84fc30227991dd4a9f0bd70688b548

Contents?: true

Size: 853 Bytes

Versions: 8

Compression:

Stored size: 853 Bytes

Contents

describe SlackRubyBot::Commands do
  let! :command do
    Class.new(SlackRubyBot::Commands::Base) do
      command 'sayhi' do |client, data, match|
        client.say(channel: data.channel, text: "#{match[:command]}: #{match[:expression]}")
      end

      command 'one', 'two' do |client, data, match|
        client.say(channel: data.channel, text: "#{match[:command]}: #{match[:expression]}")
      end
    end
  end
  def app
    SlackRubyBot::App.new
  end
  it 'supports multiple commands' do
    expect(message: "#{SlackRubyBot.config.user} sayhi arg1 arg2").to respond_with_slack_message('sayhi: arg1 arg2')
    expect(message: "#{SlackRubyBot.config.user} one arg1 arg2").to respond_with_slack_message('one: arg1 arg2')
    expect(message: "#{SlackRubyBot.config.user} two arg1 arg2").to respond_with_slack_message('two: arg1 arg2')
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
slack-ruby-bot-0.12.0 spec/slack-ruby-bot/commands/commands_with_block_spec.rb
slack-ruby-bot-0.11.2 spec/slack-ruby-bot/commands/commands_with_block_spec.rb
slack-ruby-bot-0.11.1 spec/slack-ruby-bot/commands/commands_with_block_spec.rb
slack-ruby-bot-0.11.0 spec/slack-ruby-bot/commands/commands_with_block_spec.rb
slack-ruby-bot-0.10.5 spec/slack-ruby-bot/commands/commands_with_block_spec.rb
slack-ruby-bot-0.10.4 spec/slack-ruby-bot/commands/commands_with_block_spec.rb
slack-ruby-bot-0.10.3 spec/slack-ruby-bot/commands/commands_with_block_spec.rb
slack-ruby-bot-0.10.2 spec/slack-ruby-bot/commands/commands_with_block_spec.rb