mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Implement some pending tests
This commit is contained in:
parent
cbb4c18668
commit
6665e4d396
1 changed files with 116 additions and 32 deletions
|
@ -83,13 +83,25 @@ describe Spectator::RunnableExample do
|
||||||
calls.should eq(\%i[a b])
|
calls.should eq(\%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs the hook before the test code" do
|
it "runs the hook before the test code" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks({{hook_type.id}}: ->{ calls << :a; nil })
|
||||||
|
run_example(hooks) do
|
||||||
|
calls << :b
|
||||||
|
end
|
||||||
|
calls.should eq(\%i[a b])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
pending "runs before_all hooks prior to before_each hooks" do
|
it "runs before_all hooks prior to before_each hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
before_all: ->{ calls << :a; nil },
|
||||||
|
before_each: ->{ calls << :b; nil }
|
||||||
|
)
|
||||||
|
run_example(PassingExample, hooks)
|
||||||
|
calls.should eq(%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
{% for hook_type in %i[after_all after_each] %}
|
{% for hook_type in %i[after_all after_each] %}
|
||||||
|
@ -144,13 +156,25 @@ describe Spectator::RunnableExample do
|
||||||
calls.should eq(\%i[b a])
|
calls.should eq(\%i[b a])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs the hook after the test code" do
|
it "runs the hook after the test code" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks({{hook_type.id}}: ->{ calls << :a; nil })
|
||||||
|
run_example(hooks) do
|
||||||
|
calls << :b
|
||||||
|
end
|
||||||
|
calls.should eq(\%i[b a])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
pending "runs after_each hooks prior to after_all hooks" do
|
it "runs after_each hooks prior to after_all hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
after_each: ->{ calls << :a; nil },
|
||||||
|
after_all: ->{ calls << :b; nil }
|
||||||
|
)
|
||||||
|
run_example(PassingExample, hooks)
|
||||||
|
calls.should eq(%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
context "around_each hooks" do
|
context "around_each hooks" do
|
||||||
|
@ -205,10 +229,26 @@ describe Spectator::RunnableExample do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs around_each hooks after to before hooks" do
|
it "runs around_each hooks after to before hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
before_all: ->{ calls << :b; nil },
|
||||||
|
before_each: ->{ calls << :b; nil },
|
||||||
|
around_each: ->(proc : ->) { calls << :c; proc.call }
|
||||||
|
)
|
||||||
|
run_example(PassingExample, hooks)
|
||||||
|
calls.should eq(%i[b b c])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs around_each hooks prior to after hooks" do
|
it "runs around_each hooks prior to after hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
around_each: ->(proc : ->) { calls << :c; proc.call },
|
||||||
|
after_each: ->{ calls << :a; nil },
|
||||||
|
after_all: ->{ calls << :a; nil },
|
||||||
|
)
|
||||||
|
run_example(PassingExample, hooks)
|
||||||
|
calls.should eq(%i[c a a])
|
||||||
end
|
end
|
||||||
|
|
||||||
{% for condition in %i[pre post] %}
|
{% for condition in %i[pre post] %}
|
||||||
|
@ -388,14 +428,17 @@ describe Spectator::RunnableExample do
|
||||||
run_example(FailingExample, group)
|
run_example(FailingExample, group)
|
||||||
calls.should eq(\%i[a b])
|
calls.should eq(\%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs the hook before the test code" do
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
pending "runs before_all hooks prior to before_each hooks" do
|
it "runs before_all hooks prior to before_each hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
before_all: ->{ calls << :a; nil },
|
||||||
|
before_each: ->{ calls << :b; nil }
|
||||||
|
)
|
||||||
|
run_example(FailingExample, hooks)
|
||||||
|
calls.should eq(%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
{% for hook_type in %i[after_all after_each] %}
|
{% for hook_type in %i[after_all after_each] %}
|
||||||
|
@ -449,14 +492,17 @@ describe Spectator::RunnableExample do
|
||||||
run_example(FailingExample, group)
|
run_example(FailingExample, group)
|
||||||
calls.should eq(\%i[b a])
|
calls.should eq(\%i[b a])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs the hook after the test code" do
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
pending "runs after_each hooks prior to after_all hooks" do
|
it "runs after_each hooks prior to after_all hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
after_each: ->{ calls << :a; nil },
|
||||||
|
after_all: ->{ calls << :b; nil }
|
||||||
|
)
|
||||||
|
run_example(FailingExample, hooks)
|
||||||
|
calls.should eq(%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
context "around_each hooks" do
|
context "around_each hooks" do
|
||||||
|
@ -511,10 +557,26 @@ describe Spectator::RunnableExample do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs around_each hooks after to before hooks" do
|
it "runs around_each hooks after to before hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
before_all: ->{ calls << :b; nil },
|
||||||
|
before_each: ->{ calls << :b; nil },
|
||||||
|
around_each: ->(proc : ->) { calls << :c; proc.call }
|
||||||
|
)
|
||||||
|
run_example(FailingExample, hooks)
|
||||||
|
calls.should eq(%i[b b c])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs around_each hooks prior to after hooks" do
|
it "runs around_each hooks prior to after hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
around_each: ->(proc : ->) { calls << :c; proc.call },
|
||||||
|
after_each: ->{ calls << :a; nil },
|
||||||
|
after_all: ->{ calls << :a; nil },
|
||||||
|
)
|
||||||
|
run_example(FailingExample, hooks)
|
||||||
|
calls.should eq(%i[c a a])
|
||||||
end
|
end
|
||||||
|
|
||||||
context "pre-conditions" do
|
context "pre-conditions" do
|
||||||
|
@ -669,14 +731,17 @@ describe Spectator::RunnableExample do
|
||||||
run_example(ErroredExample, group)
|
run_example(ErroredExample, group)
|
||||||
calls.should eq(\%i[a b])
|
calls.should eq(\%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs the hook before the test code" do
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
pending "runs before_all hooks prior to before_each hooks" do
|
it "runs before_all hooks prior to before_each hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
before_all: ->{ calls << :a; nil },
|
||||||
|
before_each: ->{ calls << :b; nil }
|
||||||
|
)
|
||||||
|
run_example(ErroredExample, hooks)
|
||||||
|
calls.should eq(%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
{% for hook_type in %i[after_all after_each] %}
|
{% for hook_type in %i[after_all after_each] %}
|
||||||
|
@ -730,14 +795,17 @@ describe Spectator::RunnableExample do
|
||||||
run_example(ErroredExample, group)
|
run_example(ErroredExample, group)
|
||||||
calls.should eq(\%i[b a])
|
calls.should eq(\%i[b a])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs the hook after the test code" do
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
pending "runs after_each hooks prior to after_all hooks" do
|
it "runs after_each hooks prior to after_all hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
after_each: ->{ calls << :a; nil },
|
||||||
|
after_all: ->{ calls << :b; nil }
|
||||||
|
)
|
||||||
|
run_example(ErroredExample, hooks)
|
||||||
|
calls.should eq(%i[a b])
|
||||||
end
|
end
|
||||||
|
|
||||||
context "around_each hooks" do
|
context "around_each hooks" do
|
||||||
|
@ -792,10 +860,26 @@ describe Spectator::RunnableExample do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs around_each hooks after to before hooks" do
|
it "runs around_each hooks after to before hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
before_all: ->{ calls << :b; nil },
|
||||||
|
before_each: ->{ calls << :b; nil },
|
||||||
|
around_each: ->(proc : ->) { calls << :c; proc.call }
|
||||||
|
)
|
||||||
|
run_example(ErroredExample, hooks)
|
||||||
|
calls.should eq(%i[b b c])
|
||||||
end
|
end
|
||||||
|
|
||||||
pending "runs around_each hooks prior to after hooks" do
|
it "runs around_each hooks prior to after hooks" do
|
||||||
|
calls = [] of Symbol
|
||||||
|
hooks = new_hooks(
|
||||||
|
around_each: ->(proc : ->) { calls << :c; proc.call },
|
||||||
|
after_each: ->{ calls << :a; nil },
|
||||||
|
after_all: ->{ calls << :a; nil },
|
||||||
|
)
|
||||||
|
run_example(ErroredExample, hooks)
|
||||||
|
calls.should eq(%i[c a a])
|
||||||
end
|
end
|
||||||
|
|
||||||
context "pre-conditions" do
|
context "pre-conditions" do
|
||||||
|
|
Loading…
Reference in a new issue