mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add tests for source file and line
This commit is contained in:
parent
1507a447c8
commit
88c32b697b
2 changed files with 34 additions and 0 deletions
|
@ -38,6 +38,24 @@ describe Spectator::Expectations::BlockExpectationPartial do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#source_file" do
|
||||||
|
it "is the expected value" do
|
||||||
|
block = ->{ 42 }
|
||||||
|
file = __FILE__
|
||||||
|
partial = Spectator::Expectations::BlockExpectationPartial.new(block, file, __LINE__)
|
||||||
|
partial.source_file.should eq(file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#source_line" do
|
||||||
|
it "is the expected value" do
|
||||||
|
block = ->{ 42 }
|
||||||
|
line = __LINE__
|
||||||
|
partial = Spectator::Expectations::BlockExpectationPartial.new(block, __FILE__, line)
|
||||||
|
partial.source_line.should eq(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#to" do
|
describe "#to" do
|
||||||
it "reports an expectation" do
|
it "reports an expectation" do
|
||||||
spy = SpyExample.create do
|
spy = SpyExample.create do
|
||||||
|
|
|
@ -38,6 +38,22 @@ describe Spectator::Expectations::ValueExpectationPartial do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#source_file" do
|
||||||
|
it "is the expected value" do
|
||||||
|
file = __FILE__
|
||||||
|
partial = Spectator::Expectations::ValueExpectationPartial.new(42, file, __LINE__)
|
||||||
|
partial.source_file.should eq(file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#source_line" do
|
||||||
|
it "is the expected value" do
|
||||||
|
line = __LINE__
|
||||||
|
partial = Spectator::Expectations::ValueExpectationPartial.new(42, __FILE__, line)
|
||||||
|
partial.source_line.should eq(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#to" do
|
describe "#to" do
|
||||||
it "reports an expectation" do
|
it "reports an expectation" do
|
||||||
spy = SpyExample.create do
|
spy = SpyExample.create do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue