mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use more sensible label for non-labeled procs
This commit is contained in:
parent
ac85fac968
commit
268db53bf8
2 changed files with 3 additions and 3 deletions
|
@ -30,10 +30,10 @@ describe Spectator::Expectations::BlockExpectationPartial do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when omitted" do
|
context "when omitted" do
|
||||||
it "contains a stringified version of #actual" do
|
it "contains \"proc\"" do
|
||||||
actual = ->{ 777 }
|
actual = ->{ 777 }
|
||||||
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
|
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
|
||||||
partial.label.should eq(actual.to_s)
|
partial.label.should match(/proc/i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@ module Spectator::Expectations
|
||||||
# The label is generated by calling to_s on the block.
|
# The label is generated by calling to_s on the block.
|
||||||
# The block is stored for later use.
|
# The block is stored for later use.
|
||||||
protected def initialize(@block : Proc(ReturnType), source_file, source_line)
|
protected def initialize(@block : Proc(ReturnType), source_file, source_line)
|
||||||
super(@block.to_s, source_file, source_line)
|
super("<Proc>", source_file, source_line)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue