Sha256: f10aa4a466f7bcc611367cd11854692938df681e08c99f9ad04f8975529705eb
Contents?: true
Size: 1.05 KB
Versions: 42
Compression:
Stored size: 1.05 KB
Contents
require 'test_helper' require 'singleton' module Wovnrb class StoreTest < WovnMiniTest def setup Singleton.__init__(WovnLogger) end def test_initialize log_file_name = 'test_tmp.log' Store.instance.settings({'log_path' => log_file_name}) WovnLogger.instance assert(File.exists?(log_file_name)) File.delete(log_file_name) end def test_initialize_without_path path = Store.instance.settings['log_path'] Store.instance.settings({'log_path' => nil}) WovnLogger.instance assert_equal(false, File.exists?(path)) end def test_initialize_wit_invalid_path log_file_name = 'in/val/id/test_tmp.log' Store.instance.settings({'log_path' => log_file_name}) WovnLogger.instance assert_equal(false, File.exists?(log_file_name)) assert_equal(true, File.exists?('wovn_error.log')) File.delete('wovn_error.log') end def test_error mock = LogMock.mock_log WovnLogger.instance.error('aaa') assert_equal(['aaa'], mock.errors) end end end
Version data entries
42 entries across 42 versions & 1 rubygems