@@ -33,21 +33,21 @@ defmodule PointingParty.VoteCalculatorTest do
33
33
metas_map = fixed_map ( % {
34
34
metas: list_of ( points_map , length: 1 )
35
35
} )
36
- users = nonempty ( map_of ( string ( :alphanumeric ) , metas_map ) )
36
+ user_generator = nonempty ( map_of ( string ( :alphanumeric ) , metas_map ) )
37
37
38
- [ users: users ]
38
+ [ user_generator: user_generator ]
39
39
end
40
40
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 ,
43
43
{ _event , winner } = PointingParty.VoteCalculator . calculate_votes ( users ) ,
44
44
max_runs: 20 do
45
45
assert is_list ( winner ) || is_integer ( winner )
46
46
end
47
47
end
48
48
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 ,
51
51
max_runs: 20 do
52
52
max_vote =
53
53
users
@@ -61,8 +61,8 @@ defmodule PointingParty.VoteCalculatorTest do
61
61
end
62
62
end
63
63
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 ,
66
66
{ event , winner } = PointingParty.VoteCalculator . calculate_votes ( users ) ,
67
67
max_runs: 20 do
68
68
if event == "winner" do
@@ -71,8 +71,8 @@ defmodule PointingParty.VoteCalculatorTest do
71
71
end
72
72
end
73
73
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 ,
76
76
{ event , votes } = PointingParty.VoteCalculator . calculate_votes ( users ) ,
77
77
max_runs: 20 do
78
78
if event == "tie" do
@@ -83,8 +83,8 @@ defmodule PointingParty.VoteCalculatorTest do
83
83
end
84
84
end
85
85
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 ,
88
88
{ event , votes } = PointingParty.VoteCalculator . calculate_votes ( users ) ,
89
89
max_runs: 20 do
90
90
if event == "tie" do
0 commit comments