Sha256: f1922713bd5e6ed620bbe795992b533e6dcadb502bdba6da94eb23799897b868

Contents?: true

Size: 752 Bytes

Versions: 5

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

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

      command 'tomatoes' do |client, data, match|
        client.say(channel: data.channel, text: "#{match[:command]}: #{match[:expression]}")
      end
    end
  end
  def app
    SlackRubyBot::App.new
  end
  it 'matches commands' do
    expect(message: "#{SlackRubyBot.config.user} tomato red").to respond_with_slack_message('tomato: red')
    expect(message: "#{SlackRubyBot.config.user} tomatoes green").to respond_with_slack_message('tomatoes: green')
  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/commands_precedence_spec.rb
slack-ruby-bot-0.16.0 spec/slack-ruby-bot/commands/commands_precedence_spec.rb
slack-ruby-bot-0.15.0 spec/slack-ruby-bot/commands/commands_precedence_spec.rb
slack-ruby-bot-0.14.0 spec/slack-ruby-bot/commands/commands_precedence_spec.rb
slack-ruby-bot-0.13.0 spec/slack-ruby-bot/commands/commands_precedence_spec.rb