spec/lita/message_spec.rb in lita-2.3.0 vs spec/lita/message_spec.rb in lita-2.4.0

- old
+ new

@@ -69,6 +69,21 @@ it "sends strings back to the source through the robot" do expect(robot).to receive(:send_messages).with("Carl", "foo", "bar") subject.reply("foo", "bar") end end + + describe "#reply_privately" do + it "sends strings directly to the source user" do + subject = described_class.new( + robot, + "Hello", + Lita::Source.new("Carl", "#room") + ) + expect(robot).to receive(:send_messages) do |source, *strings| + expect(source.room).to be_nil + expect(strings).to eq(["foo", "bar"]) + end + subject.reply_privately("foo", "bar") + end + end end