Sha256: 1c2c822e0d4cbfc4fa8c426db4213f8b6cbf0e126bee0ad8cbc2c49054aa9bf4
Contents?: true
Size: 530 Bytes
Versions: 18
Compression:
Stored size: 530 Bytes
Contents
require "spec_helper" describe Ruboty::Handlers::Base do after do Ruboty.handlers.pop end let(:robot) do Ruboty::Robot.new end let!(:handler_class) do Class.new(described_class) do on(/(\d+) \+ (\d+)/, name: "addition", all: true) def addition(message) robot.say(message[1].to_i + message[2].to_i) end end end describe ".on" do it "registers an action to the handler" do robot.should_receive(:say).with(2) robot.receive(body: "1 + 1") end end end
Version data entries
18 entries across 18 versions & 1 rubygems