@@ -102,34 +102,53 @@ defmodule SetDiskFreeLimitCommandTest do
102102
103103 @ tag limit: 2_097_152
104104 test "run: a valid integer input returns an ok and sets the disk free limit" , context do
105+ set_disk_free_limit ( @ default_limit )
105106 assert @ command . run ( [ context [ :limit ] ] , context [ :opts ] ) == :ok
107+ Process . sleep ( 500 )
106108 assert status ( ) [ :disk_free_limit ] === context [ :limit ]
109+
110+ set_disk_free_limit ( @ default_limit )
107111 end
108112
109113 @ tag limit: 2_097_152.0
110114 test "run: a valid non-fractional float input returns an ok and sets the disk free limit" ,
111115 context do
116+ set_disk_free_limit ( @ default_limit )
112117 assert @ command . run ( [ context [ :limit ] ] , context [ :opts ] ) == :ok
118+ Process . sleep ( 500 )
113119 assert status ( ) [ :disk_free_limit ] === round ( context [ :limit ] )
120+
121+ set_disk_free_limit ( @ default_limit )
114122 end
115123
116124 @ tag limit: 2_097_152.9
117125 test "run: a valid fractional float input returns an ok and sets the disk free limit" ,
118126 context do
127+ set_disk_free_limit ( @ default_limit )
119128 assert @ command . run ( [ context [ :limit ] ] , context [ :opts ] ) == :ok
129+ Process . sleep ( 500 )
120130 assert status ( ) [ :disk_free_limit ] === context [ :limit ] |> Float . floor ( ) |> round
131+
132+ set_disk_free_limit ( @ default_limit )
121133 end
122134
123135 @ tag limit: "2097152"
124136 test "run: an integer string input returns an ok and sets the disk free limit" , context do
137+ set_disk_free_limit ( @ default_limit )
125138 assert @ command . run ( [ context [ :limit ] ] , context [ :opts ] ) == :ok
139+ Process . sleep ( 500 )
126140 assert status ( ) [ :disk_free_limit ] === String . to_integer ( context [ :limit ] )
141+
142+ set_disk_free_limit ( @ default_limit )
127143 end
128144
129145 @ tag limit: "2MB"
130146 test "run: an valid unit string input returns an ok and changes the limit" , context do
131147 assert @ command . run ( [ context [ :limit ] ] , context [ :opts ] ) == :ok
148+ Process . sleep ( 500 )
132149 assert status ( ) [ :disk_free_limit ] === 2_000_000
150+
151+ set_disk_free_limit ( @ default_limit )
133152 end
134153
135154 ## ------------------------ run relative command -------------------------------------------
0 commit comments