Sha256: 02fdd9deca47b647c5aa5b6068672f233d2b2a1566f1a92f69f277dab5c79ca7
Contents?: true
Size: 708 Bytes
Versions: 8
Compression:
Stored size: 708 Bytes
Contents
describe SlackRubyBot::Commands do let! :command do Class.new(SlackRubyBot::Commands::Base) do operator '=' do |client, data, match| client.say(channel: data.channel, text: "#{match[:operator]}: #{match[:expression]}") end operator '+', '-' do |client, data, match| client.say(channel: data.channel, text: "#{match[:operator]}: #{match[:expression]}") end end end def app SlackRubyBot::App.new end it 'supports operator blocks' do expect(message: '=2+2').to respond_with_slack_message('=: 2+2') expect(message: '+2+2').to respond_with_slack_message('+: 2+2') expect(message: '-2+2').to respond_with_slack_message('-: 2+2') end end
Version data entries
8 entries across 8 versions & 1 rubygems