mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add spec for source class
This commit is contained in:
parent
dc66b184e2
commit
ffca0316a4
1 changed files with 28 additions and 0 deletions
28
spec/source_spec.cr
Normal file
28
spec/source_spec.cr
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
require "./spec_helper"
|
||||||
|
|
||||||
|
describe Spectator::Source do
|
||||||
|
describe "#file" do
|
||||||
|
it "is the expected value" do
|
||||||
|
file = __FILE__
|
||||||
|
source = Spectator::Source.new(file, __LINE__)
|
||||||
|
source.file.should eq(file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#line" do
|
||||||
|
it "is the expected value" do
|
||||||
|
line = __LINE__
|
||||||
|
source = Spectator::Source.new(__FILE__, line)
|
||||||
|
source.line.should eq(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#to_s" do
|
||||||
|
it "is formatted correctly" do
|
||||||
|
file = __FILE__
|
||||||
|
line = __LINE__
|
||||||
|
source = Spectator::Source.new(file, line)
|
||||||
|
source.to_s.should eq("#{file}:#{line}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue