mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Update or remove tests using result predicate methods
This commit is contained in:
parent
8dd8db74b9
commit
5722d18db9
5 changed files with 2 additions and 98 deletions
|
@ -15,30 +15,6 @@ def new_errored_result(
|
||||||
end
|
end
|
||||||
|
|
||||||
describe Spectator::ErroredResult do
|
describe Spectator::ErroredResult do
|
||||||
describe "#errored?" do
|
|
||||||
it "is true" do
|
|
||||||
new_errored_result.errored?.should be_true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#passed?" do
|
|
||||||
it "is false" do
|
|
||||||
new_errored_result.passed?.should be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#failed?" do
|
|
||||||
it "is true" do
|
|
||||||
new_errored_result.failed?.should be_true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#pending?" do
|
|
||||||
it "is false" do
|
|
||||||
new_errored_result.pending?.should be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#example" do
|
describe "#example" do
|
||||||
it "is the expected value" do
|
it "is the expected value" do
|
||||||
example = FailingExample.create
|
example = FailingExample.create
|
||||||
|
|
|
@ -15,30 +15,6 @@ def new_failed_result(
|
||||||
end
|
end
|
||||||
|
|
||||||
describe Spectator::FailedResult do
|
describe Spectator::FailedResult do
|
||||||
describe "#passed?" do
|
|
||||||
it "is false" do
|
|
||||||
new_failed_result.passed?.should be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#failed?" do
|
|
||||||
it "is true" do
|
|
||||||
new_failed_result.failed?.should be_true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#errored?" do
|
|
||||||
it "is false" do
|
|
||||||
new_failed_result.errored?.should be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#pending?" do
|
|
||||||
it "is false" do
|
|
||||||
new_failed_result.pending?.should be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#example" do
|
describe "#example" do
|
||||||
it "is the expected value" do
|
it "is the expected value" do
|
||||||
example = FailingExample.create
|
example = FailingExample.create
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe Spectator::Internals::Harness do
|
||||||
it "returns a passing result" do
|
it "returns a passing result" do
|
||||||
example = PassingExample.create
|
example = PassingExample.create
|
||||||
result = Spectator::Internals::Harness.run(example)
|
result = Spectator::Internals::Harness.run(example)
|
||||||
result.passed?.should be_true
|
result.should be_a(Spectator::SuccessfulResult)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ describe Spectator::Internals::Harness do
|
||||||
it "returns a failing result" do
|
it "returns a failing result" do
|
||||||
example = FailingExample.create
|
example = FailingExample.create
|
||||||
result = Spectator::Internals::Harness.run(example)
|
result = Spectator::Internals::Harness.run(example)
|
||||||
result.passed?.should be_false
|
result.should be_a(Spectator::FailedResult)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,30 +5,6 @@ def new_pending_result(example : Spectator::Example? = nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe Spectator::PendingResult do
|
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
|
describe "#example" do
|
||||||
it "is the expected value" do
|
it "is the expected value" do
|
||||||
example = PassingExample.create
|
example = PassingExample.create
|
||||||
|
|
|
@ -13,30 +13,6 @@ def new_successful_result(
|
||||||
end
|
end
|
||||||
|
|
||||||
describe Spectator::SuccessfulResult do
|
describe Spectator::SuccessfulResult do
|
||||||
describe "#passed?" do
|
|
||||||
it "is true" do
|
|
||||||
new_successful_result.passed?.should be_true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#failed?" do
|
|
||||||
it "is false" do
|
|
||||||
new_successful_result.failed?.should be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#errored?" do
|
|
||||||
it "is false" do
|
|
||||||
new_successful_result.errored?.should be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#pending?" do
|
|
||||||
it "is false" do
|
|
||||||
new_successful_result.pending?.should be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#example" do
|
describe "#example" do
|
||||||
it "is the expected value" do
|
it "is the expected value" do
|
||||||
example = PassingExample.create
|
example = PassingExample.create
|
||||||
|
|
Loading…
Reference in a new issue