Improve test readability in logs
This commit is contained in:
parent
6baaebddd9
commit
9918b4a71c
|
|
@ -54,7 +54,7 @@ RSpec.describe MatchService do
|
||||||
{ team_size: 256 }
|
{ team_size: 256 }
|
||||||
|
|
||||||
].each do |parameters|
|
].each do |parameters|
|
||||||
it "matches the right teams for powers of 2 (#{parameters[:team_size]})" do
|
it "the right matchups for powers of 2 (#{parameters[:team_size]})" do
|
||||||
teams = build_list(:team, parameters[:team_size], tournament: create(:tournament))
|
teams = build_list(:team, parameters[:team_size], tournament: create(:tournament))
|
||||||
generated_matches = MatchService.generate_matches teams
|
generated_matches = MatchService.generate_matches teams
|
||||||
generated_matches.each_index do |index|
|
generated_matches.each_index do |index|
|
||||||
|
|
@ -77,7 +77,7 @@ RSpec.describe MatchService do
|
||||||
{ team_size: 111 }
|
{ team_size: 111 }
|
||||||
|
|
||||||
].each do |parameters|
|
].each do |parameters|
|
||||||
it "matches the right teams for team numbers that are not powers of 2 (#{parameters[:team_size]})" ,focus: true do
|
it "the right matchups for team numbers that are not powers of 2 (#{parameters[:team_size]})" do
|
||||||
team_size = parameters[:team_size]
|
team_size = parameters[:team_size]
|
||||||
teams = build_list(:team, team_size, tournament: create(:tournament))
|
teams = build_list(:team, team_size, tournament: create(:tournament))
|
||||||
generated_matches = MatchService.generate_matches teams
|
generated_matches = MatchService.generate_matches teams
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
RSpec.describe PlayoffStageService do
|
RSpec.describe PlayoffStageService do
|
||||||
describe '#generate_empty_matches' do
|
describe 'generates' do
|
||||||
[
|
[
|
||||||
{ amount: 1 },
|
{ amount: 1 },
|
||||||
{ amount: 3 },
|
{ amount: 3 },
|
||||||
|
|
@ -12,7 +12,7 @@ RSpec.describe PlayoffStageService do
|
||||||
{ amount: 82 },
|
{ amount: 82 },
|
||||||
{ amount: 359 }
|
{ amount: 359 }
|
||||||
].each do |parameters|
|
].each do |parameters|
|
||||||
it "generates #{parameters[:amount]} empty matches" do
|
it "#{parameters[:amount]} empty matches" do
|
||||||
amount = parameters[:amount]
|
amount = parameters[:amount]
|
||||||
generated_matches = PlayoffStageService.generate_empty_matches amount
|
generated_matches = PlayoffStageService.generate_empty_matches amount
|
||||||
generated_matches.each_index do |i|
|
generated_matches.each_index do |i|
|
||||||
|
|
@ -24,7 +24,7 @@ RSpec.describe PlayoffStageService do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#generate_stages_with_empty_matches' do
|
describe 'generates' do
|
||||||
[
|
[
|
||||||
{ stages: 1 },
|
{ stages: 1 },
|
||||||
{ stages: 2 },
|
{ stages: 2 },
|
||||||
|
|
@ -37,7 +37,7 @@ RSpec.describe PlayoffStageService do
|
||||||
{ stages: 9 },
|
{ stages: 9 },
|
||||||
{ stages: 10 }
|
{ stages: 10 }
|
||||||
].each do |parameters|
|
].each do |parameters|
|
||||||
it "generates #{parameters[:stages]} stages with matches provided by #generate_empty_matches" do
|
it "#{parameters[:stages]} stages with matches provided by #generate_empty_matches" do
|
||||||
amount_of_empty_stages = parameters[:stages]
|
amount_of_empty_stages = parameters[:stages]
|
||||||
empty_stages = PlayoffStageService.generate_stages_with_empty_matches(amount_of_empty_stages)
|
empty_stages = PlayoffStageService.generate_stages_with_empty_matches(amount_of_empty_stages)
|
||||||
expect(empty_stages.size).to eq(amount_of_empty_stages)
|
expect(empty_stages.size).to eq(amount_of_empty_stages)
|
||||||
|
|
@ -51,7 +51,7 @@ RSpec.describe PlayoffStageService do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#generate_playoffs' do
|
describe 'generates playoff stages for' do
|
||||||
[
|
[
|
||||||
{ team_size: 4, expected_amount_of_playoff_stages: 2 },
|
{ team_size: 4, expected_amount_of_playoff_stages: 2 },
|
||||||
{ team_size: 8, expected_amount_of_playoff_stages: 3 },
|
{ team_size: 8, expected_amount_of_playoff_stages: 3 },
|
||||||
|
|
@ -63,7 +63,7 @@ RSpec.describe PlayoffStageService do
|
||||||
{ team_size: 64, expected_amount_of_playoff_stages: 6 },
|
{ team_size: 64, expected_amount_of_playoff_stages: 6 },
|
||||||
{ team_size: 111, expected_amount_of_playoff_stages: 7 }
|
{ team_size: 111, expected_amount_of_playoff_stages: 7 }
|
||||||
].each do |parameters|
|
].each do |parameters|
|
||||||
it "generates playoff stages for #{parameters[:team_size]} teams" do
|
it "#{parameters[:team_size]} teams" do
|
||||||
amount_of_teams = parameters[:team_size]
|
amount_of_teams = parameters[:team_size]
|
||||||
expected_amount_of_playoff_stages = parameters[:expected_amount_of_playoff_stages]
|
expected_amount_of_playoff_stages = parameters[:expected_amount_of_playoff_stages]
|
||||||
teams = build_list(:team, amount_of_teams)
|
teams = build_list(:team, amount_of_teams)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue