Skip to content

Instantly share code, notes, and snippets.

@marzzz21
Created November 15, 2016 03:47
Show Gist options
  • Save marzzz21/9aee12547db4c99c53ea3faf8ad4a9ab to your computer and use it in GitHub Desktop.
Save marzzz21/9aee12547db4c99c53ea3faf8ad4a9ab to your computer and use it in GitHub Desktop.
1 require "minitest/autorun"
2
3 Class TestMirrorSyncUtilitiesLoggingModule < Minitest::Test
4
5 def setup
6 @dummy_class = Class.new do
7 include MirrorSyncUtilities::Logging
8 end
9 end
10
11 def test_that_log_method_outputs_messages_in_correct_format
12 Time.stub :now, '2016-11-15 11:42:54 +0800' do
13 Process.stub :pid, 123 do
14 assert_equal "2016-11-15 11:42:54 +0800 > [123]This is a test", @dummy_class.log("This is a test")
15 end
16 end
17 end
18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment