shard-spectator/spec/pending_result_spec.cr

46 lines
961 B
Crystal
Raw Normal View History

2018-11-16 18:39:07 +00:00
require "./spec_helper"
def new_pending_result(example : Spectator::Example? = nil)
Spectator::PendingResult.new(example || FailingExample.create)
end
describe Spectator::PendingResult do
describe "#pending?" do
it "is true" do
new_pending_result.pending?.should be_true
end
end
describe "#passed?" do
it "is false" do
new_pending_result.passed?.should be_false
end
end
describe "#failed?" do
it "is false" do
new_pending_result.failed?.should be_false
end
end
describe "#errored?" do
it "is false" do
new_pending_result.errored?.should be_false
end
end
describe "#example" do
it "is the expected value" do
example = PassingExample.create
result = new_pending_result(example: example)
result.example.should eq(example)
end
end
describe "#elapsed" do
it "is zero" do
new_pending_result.elapsed.should eq(Time::Span.zero)
end
end
end