Commit a5979da 1 parent 7fde8ec commit a5979da Copy full SHA for a5979da
File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,35 @@ def initialize(formatter)
190
190
end
191
191
end
192
192
193
+ describe "lock and unlock log dir" do
194
+ before do
195
+ app . log_base_dir = File . join ( make_tmpdir , "log" , "path" )
196
+ end
197
+
198
+ it "locks directory" do
199
+ full_path = app . find_and_create_log_dir ( "tag" )
200
+ app . lock_log_dir
201
+
202
+ assert app . log_dir_locked?
203
+ assert_equal File . join ( full_path , ".lock" ) , app . lock_file . path
204
+ end
205
+
206
+ it "raises LogDirNotInitialized when trying to lock " \
207
+ "an unexisting directory" do
208
+ assert_raises ( Roby ::Application ::LogDirNotInitialized ) do
209
+ app . lock_log_dir
210
+ end
211
+ end
212
+
213
+ it "unlocks directory" do
214
+ full_path = app . find_and_create_log_dir ( "tag" )
215
+ app . lock_log_dir
216
+ app . unlock_log_dir
217
+
218
+ refute app . log_dir_locked?
219
+ end
220
+ end
221
+
193
222
describe "#find_and_create_log_dir" do
194
223
before do
195
224
app . log_base_dir = File . join ( make_tmpdir , "log" , "path" )
You can’t perform that action at this time.
0 commit comments