mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Support double names
This commit is contained in:
parent
26deea3d20
commit
5644d54470
2 changed files with 26 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
require "../../spec_helper"
|
||||
|
||||
Spectator.describe Spectator::Double do
|
||||
subject(dbl) { Spectator::Double.new(foo: 42, bar: "baz") }
|
||||
subject(dbl) { Spectator::Double.new("foobar", foo: 42, bar: "baz") }
|
||||
|
||||
it "responds to defined messages" do
|
||||
aggregate_failures do
|
||||
|
@ -14,6 +14,18 @@ Spectator.describe Spectator::Double do
|
|||
expect { dbl.baz }.to raise_error(Spectator::UnexpectedMessage)
|
||||
end
|
||||
|
||||
it "reports the name in errors" do
|
||||
expect { dbl.baz }.to raise_error(/foobar/)
|
||||
end
|
||||
|
||||
context "without a double name" do
|
||||
subject(dbl) { Spectator::Double.new(foo: 42) }
|
||||
|
||||
it "reports as anonymous" do
|
||||
expect { dbl.baz }.to raise_error(/anonymous/i)
|
||||
end
|
||||
end
|
||||
|
||||
context "with common object methods" do
|
||||
subject(dbl) do
|
||||
Spectator::Double.new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue