magellan 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/magellan/logger.rb +1 -0
- data/spec/logger_spec.rb +13 -8
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/magellan/logger.rb
CHANGED
data/spec/logger_spec.rb
CHANGED
@@ -27,14 +27,19 @@ describe Magellan::Logger do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
it "should
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
it "should create a log file but leave it empty if one is passed in and the updated passed" do
|
31
|
+
begin
|
32
|
+
log = File.dirname(__FILE__) + "/log2.txt"
|
33
|
+
FileUtils.rm(log,:force => true)
|
34
|
+
File.exists?(log).should be_false
|
35
|
+
$stdout.stubs(:putc)
|
36
|
+
logger =Magellan::Logger.new(log)
|
37
|
+
logger.update(Time.now,true,'foozor')
|
38
|
+
File.exists?(log).should be_true
|
39
|
+
File.open(log).readlines.size.should eql(0)
|
40
|
+
ensure
|
41
|
+
FileUtils.rm(log,:force => true)
|
42
|
+
end
|
38
43
|
end
|
39
44
|
|
40
45
|
end
|