Remove unused block arguments

This commit is contained in:
Michael Miller 2019-04-06 17:20:12 -06:00
parent 53bfcc25ef
commit 3eb6a1d676
5 changed files with 20 additions and 20 deletions

View file

@ -30,7 +30,7 @@ describe Spectator::ExampleIterator do
it "iterates through all examples" do it "iterates through all examples" do
examples = [] of Spectator::Example examples = [] of Spectator::Example
group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty) group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
group.children = Array(Spectator::ExampleComponent).new(5) do |_| group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty) PassingExample.new(group, Spectator::Internals::SampleValues.empty)
end end
iterator = Spectator::ExampleIterator.new(group) iterator = Spectator::ExampleIterator.new(group)
@ -40,7 +40,7 @@ describe Spectator::ExampleIterator do
it "returns 'stop' at the end" do it "returns 'stop' at the end" do
group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty) group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
group.children = Array(Spectator::ExampleComponent).new(5) do |_| group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty) PassingExample.new(group, Spectator::Internals::SampleValues.empty)
end end
iterator = Spectator::ExampleIterator.new(group) iterator = Spectator::ExampleIterator.new(group)
@ -93,7 +93,7 @@ describe Spectator::ExampleIterator do
end end
else else
Spectator::NestedExampleGroup.new(i.to_s, group, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group| Spectator::NestedExampleGroup.new(i.to_s, group, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group|
sub_group.children = Array(Spectator::ExampleComponent).new(5) do |_| sub_group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(sub_group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(sub_group, Spectator::Internals::SampleValues.empty).tap do |example|
expected_examples << example expected_examples << example
end end
@ -113,7 +113,7 @@ describe Spectator::ExampleIterator do
PassingExample.new(group, Spectator::Internals::SampleValues.empty) PassingExample.new(group, Spectator::Internals::SampleValues.empty)
else else
Spectator::NestedExampleGroup.new(i.to_s, group, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group| Spectator::NestedExampleGroup.new(i.to_s, group, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group|
sub_group.children = Array(Spectator::ExampleComponent).new(5) do |_| sub_group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(sub_group, Spectator::Internals::SampleValues.empty) PassingExample.new(sub_group, Spectator::Internals::SampleValues.empty)
end end
end end
@ -138,7 +138,7 @@ describe Spectator::ExampleIterator do
Spectator::NestedExampleGroup.new(j.to_s, sub_group1, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group2| Spectator::NestedExampleGroup.new(j.to_s, sub_group1, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group2|
sub_group2.children = Array(Spectator::ExampleComponent).new(5) do |k| sub_group2.children = Array(Spectator::ExampleComponent).new(5) do |k|
Spectator::NestedExampleGroup.new(k.to_s, sub_group2, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group3| Spectator::NestedExampleGroup.new(k.to_s, sub_group2, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group3|
sub_group3.children = Array(Spectator::ExampleComponent).new(5) do |_| sub_group3.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(sub_group3, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(sub_group3, Spectator::Internals::SampleValues.empty).tap do |example|
expected_examples << example expected_examples << example
end end
@ -162,7 +162,7 @@ describe Spectator::ExampleIterator do
Spectator::NestedExampleGroup.new(j.to_s, sub_group1, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group2| Spectator::NestedExampleGroup.new(j.to_s, sub_group1, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group2|
sub_group2.children = Array(Spectator::ExampleComponent).new(5) do |k| sub_group2.children = Array(Spectator::ExampleComponent).new(5) do |k|
Spectator::NestedExampleGroup.new(k.to_s, sub_group2, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group3| Spectator::NestedExampleGroup.new(k.to_s, sub_group2, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group3|
sub_group3.children = Array(Spectator::ExampleComponent).new(5) do |_| sub_group3.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(sub_group3, Spectator::Internals::SampleValues.empty) PassingExample.new(sub_group3, Spectator::Internals::SampleValues.empty)
end end
end end

View file

@ -28,7 +28,7 @@ def nested_group_with_sub_groups(sub_group_count = 5, example_count = 5)
examples = [] of Spectator::Example examples = [] of Spectator::Example
group.children = Array(Spectator::ExampleComponent).new(sub_group_count) do |i| group.children = Array(Spectator::ExampleComponent).new(sub_group_count) do |i|
Spectator::NestedExampleGroup.new(i.to_s, group, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group| Spectator::NestedExampleGroup.new(i.to_s, group, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group|
sub_group.children = Array(Spectator::ExampleComponent).new(example_count) do |_| sub_group.children = Array(Spectator::ExampleComponent).new(example_count) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example|
examples << example examples << example
end end
@ -359,7 +359,7 @@ describe Spectator::NestedExampleGroup do
root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty) root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
group = Spectator::NestedExampleGroup.new("what", root, hooks, Spectator::ExampleConditions.empty) group = Spectator::NestedExampleGroup.new("what", root, hooks, Spectator::ExampleConditions.empty)
root.children = [group.as(Spectator::ExampleComponent)] root.children = [group.as(Spectator::ExampleComponent)]
group.children = Array(Spectator::ExampleComponent).new(5) do |_| group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example|
examples << example examples << example
end end
@ -378,7 +378,7 @@ describe Spectator::NestedExampleGroup do
root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty) root = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
group = Spectator::NestedExampleGroup.new("what", root, hooks, Spectator::ExampleConditions.empty) group = Spectator::NestedExampleGroup.new("what", root, hooks, Spectator::ExampleConditions.empty)
root.children = [group.as(Spectator::ExampleComponent)] root.children = [group.as(Spectator::ExampleComponent)]
group.children = Array(Spectator::ExampleComponent).new(5) do |_| group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example|
examples << example examples << example
end end
@ -397,7 +397,7 @@ describe Spectator::NestedExampleGroup do
root = Spectator::RootExampleGroup.new(hooks, Spectator::ExampleConditions.empty) root = Spectator::RootExampleGroup.new(hooks, Spectator::ExampleConditions.empty)
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)]
group.children = Array(Spectator::ExampleComponent).new(5) do |_| group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example|
examples << example examples << example
end end
@ -416,7 +416,7 @@ describe Spectator::NestedExampleGroup do
root = Spectator::RootExampleGroup.new(hooks, Spectator::ExampleConditions.empty) root = Spectator::RootExampleGroup.new(hooks, Spectator::ExampleConditions.empty)
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)]
group.children = Array(Spectator::ExampleComponent).new(5) do |_| group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example|
examples << example examples << example
end end

View file

@ -22,7 +22,7 @@ def root_group_with_sub_groups(sub_group_count = 5, example_count = 5)
examples = [] of Spectator::Example examples = [] of Spectator::Example
group.children = Array(Spectator::ExampleComponent).new(sub_group_count) do |i| group.children = Array(Spectator::ExampleComponent).new(sub_group_count) do |i|
Spectator::NestedExampleGroup.new(i.to_s, group, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group| Spectator::NestedExampleGroup.new(i.to_s, group, Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty).tap do |sub_group|
sub_group.children = Array(Spectator::ExampleComponent).new(example_count) do |_| sub_group.children = Array(Spectator::ExampleComponent).new(example_count) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example|
examples << example examples << example
end end
@ -246,7 +246,7 @@ describe Spectator::RootExampleGroup do
examples = [] of Spectator::Example examples = [] of Spectator::Example
hooks = new_hooks(after_all: ->{ called = true; nil }) hooks = new_hooks(after_all: ->{ called = true; nil })
group = Spectator::RootExampleGroup.new(hooks, Spectator::ExampleConditions.empty) group = Spectator::RootExampleGroup.new(hooks, Spectator::ExampleConditions.empty)
group.children = Array(Spectator::ExampleComponent).new(5) do |_| group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example|
examples << example examples << example
end end
@ -263,7 +263,7 @@ describe Spectator::RootExampleGroup do
examples = [] of Spectator::Example examples = [] of Spectator::Example
hooks = new_hooks(after_each: ->{ called = true; nil }) hooks = new_hooks(after_each: ->{ called = true; nil })
group = Spectator::RootExampleGroup.new(hooks, Spectator::ExampleConditions.empty) group = Spectator::RootExampleGroup.new(hooks, Spectator::ExampleConditions.empty)
group.children = Array(Spectator::ExampleComponent).new(5) do |_| group.children = Array(Spectator::ExampleComponent).new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example| PassingExample.new(group, Spectator::Internals::SampleValues.empty).tap do |example|
examples << example examples << example
end end

View file

@ -100,7 +100,7 @@ describe Spectator::Runner do
end end
it "#start_example is called for each example" do it "#start_example is called for each example" do
group = SpyExample.create_group(5) { |_| nil } group = SpyExample.create_group(5) { nil }
suite = new_test_suite(group) suite = new_test_suite(group)
spy = SpyFormatter.new spy = SpyFormatter.new
runner = Spectator::Runner.new(suite, spectator_test_config(spy)) runner = Spectator::Runner.new(suite, spectator_test_config(spy))
@ -109,7 +109,7 @@ describe Spectator::Runner do
end end
it "passes the correct example to #start_example" do it "passes the correct example to #start_example" do
group = SpyExample.create_group(5) { |_| nil } group = SpyExample.create_group(5) { nil }
suite = new_test_suite(group) suite = new_test_suite(group)
spy = SpyFormatter.new spy = SpyFormatter.new
runner = Spectator::Runner.new(suite, spectator_test_config(spy)) runner = Spectator::Runner.new(suite, spectator_test_config(spy))
@ -125,7 +125,7 @@ describe Spectator::Runner do
end end
it "calls #end_example for each example" do it "calls #end_example for each example" do
group = SpyExample.create_group(5) { |_| nil } group = SpyExample.create_group(5) { nil }
suite = new_test_suite(group) suite = new_test_suite(group)
spy = SpyFormatter.new spy = SpyFormatter.new
runner = Spectator::Runner.new(suite, spectator_test_config(spy)) runner = Spectator::Runner.new(suite, spectator_test_config(spy))
@ -175,7 +175,7 @@ describe Spectator::Runner do
end end
it "contains the expected time span" do it "contains the expected time span" do
group = SpyExample.create_group(5) { |_| nil } group = SpyExample.create_group(5) { nil }
suite = new_test_suite(group) suite = new_test_suite(group)
spy = SpyFormatter.new spy = SpyFormatter.new
runner = Spectator::Runner.new(suite, spectator_test_config(spy)) runner = Spectator::Runner.new(suite, spectator_test_config(spy))

View file

@ -4,7 +4,7 @@ describe Spectator::TestSuite do
describe "#each" do describe "#each" do
it "yields each example" do it "yields each example" do
group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty) group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
group.children = Array.new(5) do |_| group.children = Array.new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).as(Spectator::ExampleComponent) PassingExample.new(group, Spectator::Internals::SampleValues.empty).as(Spectator::ExampleComponent)
end end
test_suite = Spectator::TestSuite.new(group, Spectator::NullExampleFilter.new) test_suite = Spectator::TestSuite.new(group, Spectator::NullExampleFilter.new)
@ -17,7 +17,7 @@ describe Spectator::TestSuite do
it "skips examples not in the filter" do it "skips examples not in the filter" do
group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty) group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
group.children = Array.new(5) do |_| group.children = Array.new(5) do
PassingExample.new(group, Spectator::Internals::SampleValues.empty).as(Spectator::ExampleComponent) PassingExample.new(group, Spectator::Internals::SampleValues.empty).as(Spectator::ExampleComponent)
end end
test_suite = Spectator::TestSuite.new(group, Spectator::CompositeExampleFilter.new([] of Spectator::ExampleFilter)) test_suite = Spectator::TestSuite.new(group, Spectator::CompositeExampleFilter.new([] of Spectator::ExampleFilter))