magellan 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 1
3
- :patch: 1
3
+ :patch: 2
4
4
  :major: 0
@@ -2,6 +2,7 @@ module Magellan
2
2
  class Logger
3
3
  def initialize(file_name=nil)
4
4
  @file_name = file_name
5
+ File.open(@file_name, 'a') {} if @file_name
5
6
  end
6
7
 
7
8
  def update(time,passed,message)
@@ -27,14 +27,19 @@ describe Magellan::Logger do
27
27
  end
28
28
  end
29
29
 
30
- it "should not a log file if one is passed in and the updated passed" do
31
- log = File.dirname(__FILE__) + "/log2.txt"
32
- FileUtils.rm(log,:force => true)
33
- File.exists?(log).should be_false
34
- $stdout.stubs(:putc)
35
- logger =Magellan::Logger.new(log)
36
- logger.update(Time.now,true,'foozor')
37
- File.exists?(log).should be_false
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magellan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nolan Evans