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