spec/lita/message_spec.rb in lita-2.7.2 vs spec/lita/message_spec.rb in lita-3.0.0
- old
+ new
@@ -1,10 +1,10 @@
require "spec_helper"
describe Lita::Message do
let(:robot) do
- double("Lita::Robot", name: "Lita", mention_name: "LitaBot", alias: ".")
+ instance_double("Lita::Robot", name: "Lita", mention_name: "LitaBot", alias: ".")
end
subject do
described_class.new(robot, "Hello", "Carl")
end
@@ -18,16 +18,16 @@
end
describe "#args" do
it "returns an array of the 2nd through nth word in the message" do
subject = described_class.new(robot, "args foo bar", "Carl")
- expect(subject.args).to eq(["foo", "bar"])
+ expect(subject.args).to eq(%w(foo bar))
end
it "escapes messages that have mismatched quotes" do
subject = described_class.new(robot, "args it's working", "Carl")
- expect(subject.args).to eq(["it's", "working"])
+ expect(subject.args).to eq(%w(it's working))
end
end
describe "#command!" do
it "marks a message as a command" do
@@ -90,10 +90,10 @@
"Hello",
Lita::Source.new(user: "Carl", room: "#room")
)
expect(robot).to receive(:send_messages) do |source, *strings|
expect(source).to be_a_private_message
- expect(strings).to eq(["foo", "bar"])
+ expect(strings).to eq(%w(foo bar))
end
subject.reply_privately("foo", "bar")
end
end
end