Sha256: 19d22485d065632dae7e86421a9c1b51378efbd91b553a2cd56934b7bd64a00a
Contents?: true
Size: 876 Bytes
Versions: 10
Compression:
Stored size: 876 Bytes
Contents
require 'spec_helper' 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
10 entries across 10 versions & 1 rubygems