Sha256: 02aa63ad46d80680d86cea58c587869c941698ff1f38c053e1f102921f3fd623

Contents?: true

Size: 687 Bytes

Versions: 7

Compression:

Stored size: 687 Bytes

Contents

require "#{File.dirname(__FILE__)}/test_helper"

class LogTest < Test::Unit::TestCase
  context "A default Log" do
    setup do
      @log = Pork::Log.new('testlog.txt',{:researcher => "Researcher", :project => "Project"})
    end

    should "be able to be created" do
      @log.inspect
    end
    
    should 'be able to write to the specified log file' do
      @log.write("testing123")
      log_string = ""
      File.open('testlog.txt','r').each do |line|
        log_string << line
      end
      assert log_string.include?("testing123")
      assert log_string.include?("Project, Researcher")
    end
    
    teardown do 
      File.delete('testlog.txt')
    end
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pork_sandwich-0.4.23 test/log_test.rb
pork_sandwich-0.4.22 test/log_test.rb
pork_sandwich-0.4.21 test/log_test.rb
pork_sandwich-0.4.20 test/log_test.rb
pork_sandwich-0.4.19 test/log_test.rb
pork_sandwich-0.4.18 test/log_test.rb
pork_sandwich-0.4.17 test/log_test.rb