Formatting

This commit is contained in:
Michael Miller 2019-01-23 23:16:18 -07:00
parent a869d4f23f
commit cbb4c18668

View file

@ -90,7 +90,6 @@ describe Spectator::RunnableExample do
{% end %} {% end %}
pending "runs before_all hooks prior to before_each hooks" do pending "runs before_all hooks prior to before_each hooks" do
end end
{% for hook_type in %i[after_all after_each] %} {% for hook_type in %i[after_all after_each] %}
@ -152,7 +151,6 @@ describe Spectator::RunnableExample do
{% end %} {% end %}
pending "runs after_each hooks prior to after_all hooks" do pending "runs after_each hooks prior to after_all hooks" do
end end
context "around_each hooks" do context "around_each hooks" do
@ -208,11 +206,9 @@ describe Spectator::RunnableExample do
end end
pending "runs around_each hooks after to before hooks" do pending "runs around_each hooks after to before hooks" do
end end
pending "runs around_each hooks prior to after hooks" do pending "runs around_each hooks prior to after hooks" do
end end
{% for condition in %i[pre post] %} {% for condition in %i[pre post] %}
@ -283,69 +279,54 @@ describe Spectator::RunnableExample do
{% end %} {% end %}
pending "runs before hooks prior to pre-conditions" do pending "runs before hooks prior to pre-conditions" do
end end
pending "runs around_each hooks prior to pre-conditions" do pending "runs around_each hooks prior to pre-conditions" do
end end
pending "runs post-conditions prior to after hooks" do pending "runs post-conditions prior to after hooks" do
end end
context "failing pre-condition" do context "failing pre-condition" do
pending "fails the test" do pending "fails the test" do
end end
pending "prevents the test code from running" do pending "prevents the test code from running" do
end end
pending "prevents additional pre-conditions from running" do pending "prevents additional pre-conditions from running" do
end end
pending "prevents additional post-conditiosn from running" do pending "prevents additional post-conditiosn from running" do
end end
context "in a parent group" do context "in a parent group" do
pending "fails the test" do pending "fails the test" do
end end
pending "prevents the test code from running" do pending "prevents the test code from running" do
end end
pending "doesn't run child pre-conditions" do pending "doesn't run child pre-conditions" do
end end
pending "doesn't run child post-conditions" do pending "doesn't run child post-conditions" do
end end
end end
end end
context "failing post-condition" do context "failing post-condition" do
pending "fails the test" do pending "fails the test" do
end end
pending "prevents additional post-conditions from running" do pending "prevents additional post-conditions from running" do
end end
context "in a parent group" do context "in a parent group" do
pending "fails the test" do pending "fails the test" do
end end
pending "doesn't run child post-conditions" do pending "doesn't run child post-conditions" do
end end
end end
end end
@ -415,7 +396,6 @@ describe Spectator::RunnableExample do
{% end %} {% end %}
pending "runs before_all hooks prior to before_each hooks" do pending "runs before_all hooks prior to before_each hooks" do
end end
{% for hook_type in %i[after_all after_each] %} {% for hook_type in %i[after_all after_each] %}
@ -477,7 +457,6 @@ describe Spectator::RunnableExample do
{% end %} {% end %}
pending "runs after_each hooks prior to after_all hooks" do pending "runs after_each hooks prior to after_all hooks" do
end end
context "around_each hooks" do context "around_each hooks" do
@ -533,17 +512,15 @@ describe Spectator::RunnableExample do
end end
pending "runs around_each hooks after to before hooks" do pending "runs around_each hooks after to before hooks" do
end end
pending "runs around_each hooks prior to after hooks" do pending "runs around_each hooks prior to after hooks" do
end end
context "pre-conditions" do context "pre-conditions" do
it "checks a single condition" do it "checks a single condition" do
called = false called = false
conditions = new_conditions(pre: -> { called = true; nil }) conditions = new_conditions(pre: ->{ called = true; nil })
run_example(FailingExample, conditions: conditions) run_example(FailingExample, conditions: conditions)
called.should be_true called.should be_true
end end
@ -551,9 +528,9 @@ describe Spectator::RunnableExample do
it "checks multiple conditions" do it "checks multiple conditions" do
call_count = 0 call_count = 0
conditions = new_conditions(pre: [ conditions = new_conditions(pre: [
-> { call_count += 1; nil }, ->{ call_count += 1; nil },
-> { call_count += 2; nil }, ->{ call_count += 2; nil },
-> { call_count += 3; nil }, ->{ call_count += 3; nil },
]) ])
run_example(FailingExample, conditions: conditions) run_example(FailingExample, conditions: conditions)
call_count.should eq(6) call_count.should eq(6)
@ -562,9 +539,9 @@ describe Spectator::RunnableExample do
it "checks them in the correct order" do it "checks them in the correct order" do
calls = [] of Symbol calls = [] of Symbol
conditions = new_conditions(pre: [ conditions = new_conditions(pre: [
-> { calls << :a; nil }, ->{ calls << :a; nil },
-> { calls << :b; nil }, ->{ calls << :b; nil },
-> { calls << :c; nil }, ->{ calls << :c; nil },
]) ])
run_example(FailingExample, conditions: conditions) run_example(FailingExample, conditions: conditions)
calls.should eq(%i[a b c]) calls.should eq(%i[a b c])
@ -572,7 +549,7 @@ describe Spectator::RunnableExample do
it "checks parent group conditions" do it "checks parent group conditions" do
called = false called = false
conditions = new_conditions(pre: -> { called = true; nil }) conditions = new_conditions(pre: ->{ called = true; nil })
root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, conditions) root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, conditions)
group = Spectator::NestedExampleGroup.new("what", root, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty) group = Spectator::NestedExampleGroup.new("what", root, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
root.children = [group.as(Spectator::ExampleComponent)] root.children = [group.as(Spectator::ExampleComponent)]
@ -582,8 +559,8 @@ describe Spectator::RunnableExample do
it "checks parent group conditions first" do it "checks parent group conditions first" do
calls = [] of Symbol calls = [] of Symbol
root_conditions = new_conditions(pre: -> { calls << :a; nil }) root_conditions = new_conditions(pre: ->{ calls << :a; nil })
group_conditions = new_conditions(pre: -> { calls << :b; nil }) group_conditions = new_conditions(pre: ->{ calls << :b; nil })
root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, root_conditions) root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, root_conditions)
group = Spectator::NestedExampleGroup.new("what", root, Spectator::ExampleHooks.empty, group_conditions) group = Spectator::NestedExampleGroup.new("what", root, Spectator::ExampleHooks.empty, group_conditions)
root.children = [group.as(Spectator::ExampleComponent)] root.children = [group.as(Spectator::ExampleComponent)]
@ -593,59 +570,46 @@ describe Spectator::RunnableExample do
end end
pending "runs before hooks prior to pre-conditions" do pending "runs before hooks prior to pre-conditions" do
end end
pending "runs around_each hooks prior to pre-conditions" do pending "runs around_each hooks prior to pre-conditions" do
end end
pending "runs post-conditions prior to after hooks" do pending "runs post-conditions prior to after hooks" do
end end
context "failing pre-condition" do context "failing pre-condition" do
pending "fails the test" do pending "fails the test" do
end end
pending "prevents the test code from running" do pending "prevents the test code from running" do
end end
pending "prevents additional pre-conditions from running" do pending "prevents additional pre-conditions from running" do
end end
pending "prevents additional post-conditiosn from running" do pending "prevents additional post-conditiosn from running" do
end end
context "in a parent group" do context "in a parent group" do
pending "fails the test" do pending "fails the test" do
end end
pending "prevents the test code from running" do pending "prevents the test code from running" do
end end
pending "doesn't run child pre-conditions" do pending "doesn't run child pre-conditions" do
end end
pending "doesn't run child post-conditions" do pending "doesn't run child post-conditions" do
end end
end end
end end
pending "doesn't run post-conditions" do pending "doesn't run post-conditions" do
end end
pending "doesn't run parent group post-conditions" do pending "doesn't run parent group post-conditions" do
end end
end end
@ -713,7 +677,6 @@ describe Spectator::RunnableExample do
{% end %} {% end %}
pending "runs before_all hooks prior to before_each hooks" do pending "runs before_all hooks prior to before_each hooks" do
end end
{% for hook_type in %i[after_all after_each] %} {% for hook_type in %i[after_all after_each] %}
@ -775,7 +738,6 @@ describe Spectator::RunnableExample do
{% end %} {% end %}
pending "runs after_each hooks prior to after_all hooks" do pending "runs after_each hooks prior to after_all hooks" do
end end
context "around_each hooks" do context "around_each hooks" do
@ -831,17 +793,15 @@ describe Spectator::RunnableExample do
end end
pending "runs around_each hooks after to before hooks" do pending "runs around_each hooks after to before hooks" do
end end
pending "runs around_each hooks prior to after hooks" do pending "runs around_each hooks prior to after hooks" do
end end
context "pre-conditions" do context "pre-conditions" do
it "checks a single condition" do it "checks a single condition" do
called = false called = false
conditions = new_conditions(pre: -> { called = true; nil }) conditions = new_conditions(pre: ->{ called = true; nil })
run_example(ErroredExample, conditions: conditions) run_example(ErroredExample, conditions: conditions)
called.should be_true called.should be_true
end end
@ -849,9 +809,9 @@ describe Spectator::RunnableExample do
it "checks multiple conditions" do it "checks multiple conditions" do
call_count = 0 call_count = 0
conditions = new_conditions(pre: [ conditions = new_conditions(pre: [
-> { call_count += 1; nil }, ->{ call_count += 1; nil },
-> { call_count += 2; nil }, ->{ call_count += 2; nil },
-> { call_count += 3; nil }, ->{ call_count += 3; nil },
]) ])
run_example(ErroredExample, conditions: conditions) run_example(ErroredExample, conditions: conditions)
call_count.should eq(6) call_count.should eq(6)
@ -860,9 +820,9 @@ describe Spectator::RunnableExample do
it "checks them in the correct order" do it "checks them in the correct order" do
calls = [] of Symbol calls = [] of Symbol
conditions = new_conditions(pre: [ conditions = new_conditions(pre: [
-> { calls << :a; nil }, ->{ calls << :a; nil },
-> { calls << :b; nil }, ->{ calls << :b; nil },
-> { calls << :c; nil }, ->{ calls << :c; nil },
]) ])
run_example(ErroredExample, conditions: conditions) run_example(ErroredExample, conditions: conditions)
calls.should eq(%i[a b c]) calls.should eq(%i[a b c])
@ -870,7 +830,7 @@ describe Spectator::RunnableExample do
it "checks parent group conditions" do it "checks parent group conditions" do
called = false called = false
conditions = new_conditions(pre: -> { called = true; nil }) conditions = new_conditions(pre: ->{ called = true; nil })
root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, conditions) root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, conditions)
group = Spectator::NestedExampleGroup.new("what", root, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty) group = Spectator::NestedExampleGroup.new("what", root, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
root.children = [group.as(Spectator::ExampleComponent)] root.children = [group.as(Spectator::ExampleComponent)]
@ -880,8 +840,8 @@ describe Spectator::RunnableExample do
it "checks parent group conditions first" do it "checks parent group conditions first" do
calls = [] of Symbol calls = [] of Symbol
root_conditions = new_conditions(pre: -> { calls << :a; nil }) root_conditions = new_conditions(pre: ->{ calls << :a; nil })
group_conditions = new_conditions(pre: -> { calls << :b; nil }) group_conditions = new_conditions(pre: ->{ calls << :b; nil })
root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, root_conditions) root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, root_conditions)
group = Spectator::NestedExampleGroup.new("what", root, Spectator::ExampleHooks.empty, group_conditions) group = Spectator::NestedExampleGroup.new("what", root, Spectator::ExampleHooks.empty, group_conditions)
root.children = [group.as(Spectator::ExampleComponent)] root.children = [group.as(Spectator::ExampleComponent)]
@ -891,59 +851,46 @@ describe Spectator::RunnableExample do
end end
pending "runs before hooks prior to pre-conditions" do pending "runs before hooks prior to pre-conditions" do
end end
pending "runs around_each hooks prior to pre-conditions" do pending "runs around_each hooks prior to pre-conditions" do
end end
pending "runs post-conditions prior to after hooks" do pending "runs post-conditions prior to after hooks" do
end end
context "failing pre-condition" do context "failing pre-condition" do
pending "fails the test" do pending "fails the test" do
end end
pending "prevents the test code from running" do pending "prevents the test code from running" do
end end
pending "prevents additional pre-conditions from running" do pending "prevents additional pre-conditions from running" do
end end
pending "prevents additional post-conditiosn from running" do pending "prevents additional post-conditiosn from running" do
end end
context "in a parent group" do context "in a parent group" do
pending "fails the test" do pending "fails the test" do
end end
pending "prevents the test code from running" do pending "prevents the test code from running" do
end end
pending "doesn't run child pre-conditions" do pending "doesn't run child pre-conditions" do
end end
pending "doesn't run child post-conditions" do pending "doesn't run child post-conditions" do
end end
end end
end end
pending "doesn't run post-conditions" do pending "doesn't run post-conditions" do
end end
pending "doesn't run parent group post-conditions" do pending "doesn't run parent group post-conditions" do
end end
end end