mortar 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -256,7 +256,7 @@ class Mortar::Local::Pig
256
256
  end
257
257
 
258
258
  def reset_local_logs
259
- if Dir.exists? local_log_dir
259
+ if File.directory? local_log_dir
260
260
  FileUtils.rm_rf local_log_dir
261
261
  end
262
262
  Dir.mkdir local_log_dir
@@ -16,5 +16,5 @@
16
16
 
17
17
  module Mortar
18
18
  # see http://semver.org/
19
- VERSION = "0.7.6"
19
+ VERSION = "0.7.7"
20
20
  end
@@ -201,5 +201,22 @@ module Mortar::Local
201
201
 
202
202
  end
203
203
 
204
+ context "reset_local_logs" do
205
+
206
+ it "removes the directory if it exists" do
207
+ pig = Mortar::Local::Pig.new
208
+ marker_file = pig.local_log_dir + "/marker-file"
209
+ FakeFS do
210
+ FileUtils.mkdir_p(pig.local_log_dir)
211
+ FileUtils.touch(marker_file)
212
+ expect(File.exists?(marker_file)).to be_true
213
+ pig.reset_local_logs
214
+ expect(File.exists?(marker_file)).to be_false
215
+ end
216
+
217
+ end
218
+ end
219
+
220
+
204
221
  end
205
222
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mortar
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 6
10
- version: 0.7.6
9
+ - 7
10
+ version: 0.7.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mortar Data