@@ -33,21 +33,21 @@ defmodule PointingParty.VoteCalculatorTest do
3333 metas_map = fixed_map ( % {
3434 metas: list_of ( points_map , length: 1 )
3535 } )
36- users = nonempty ( map_of ( string ( :alphanumeric ) , metas_map ) )
36+ user_generator = nonempty ( map_of ( string ( :alphanumeric ) , metas_map ) )
3737
38- [ users: users ]
38+ [ user_generator: user_generator ]
3939 end
4040
41- property "calculated vote is a list or an integer" , % { users: users } do
42- check all users <- users ,
41+ property "calculated vote is a list or an integer" , % { user_generator: user_generator } do
42+ check all users <- user_generator ,
4343 { _event , winner } = PointingParty.VoteCalculator . calculate_votes ( users ) ,
4444 max_runs: 20 do
4545 assert is_list ( winner ) || is_integer ( winner )
4646 end
4747 end
4848
49- property "the winning value is not more than the highest vote" , % { users: users } do
50- check all users <- users ,
49+ property "the winning value is not more than the highest vote" , % { user_generator: user_generator } do
50+ check all users <- user_generator ,
5151 max_runs: 20 do
5252 max_vote =
5353 users
@@ -61,8 +61,8 @@ defmodule PointingParty.VoteCalculatorTest do
6161 end
6262 end
6363
64- property "when there is a winner, calculated vote is a valid integer" , % { users: users } do
65- check all users <- users ,
64+ property "when there is a winner, calculated vote is a valid integer" , % { user_generator: user_generator } do
65+ check all users <- user_generator ,
6666 { event , winner } = PointingParty.VoteCalculator . calculate_votes ( users ) ,
6767 max_runs: 20 do
6868 if event == "winner" do
@@ -71,8 +71,8 @@ defmodule PointingParty.VoteCalculatorTest do
7171 end
7272 end
7373
74- property "when there is a tie, calculated vote is a list with two sorted values" , % { users: users } do
75- check all users <- users ,
74+ property "when there is a tie, calculated vote is a list with two sorted values" , % { user_generator: user_generator } do
75+ check all users <- user_generator ,
7676 { event , votes } = PointingParty.VoteCalculator . calculate_votes ( users ) ,
7777 max_runs: 20 do
7878 if event == "tie" do
@@ -83,8 +83,8 @@ defmodule PointingParty.VoteCalculatorTest do
8383 end
8484 end
8585
86- property "when there is a tie, calculated vote is a list whose elements are valid integers" , % { users: users } do
87- check all users <- users ,
86+ property "when there is a tie, calculated vote is a list of valid integers" , % { user_generator: user_generator } do
87+ check all users <- user_generator ,
8888 { event , votes } = PointingParty.VoteCalculator . calculate_votes ( users ) ,
8989 max_runs: 20 do
9090 if event == "tie" do
0 commit comments