logger-better 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logger-better/version.rb +1 -1
- data/lib/logger/null_logger.rb +2 -2
- data/test/null_logger_test.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1240ecdb63276440b7a88815f3f82ba3414232c6
|
4
|
+
data.tar.gz: 6a0c6492f60e882660e605cddf7e7eff486c130f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b30925e9f820ec578df34c89bf5e56291d99b859de7bdd36496fccc11540dbedc063a5c8fe544572999d8acfa78def9f8b628b3e1d2ce79cb9560d361ce61d54
|
7
|
+
data.tar.gz: 9c233ad88d62897b839b865db2382499097e45fbe368ac1379376bed390a8d49503a0b37b8cb66d126dfd2f9d4072b23194a711686189205b8a5bf215bb340b6
|
data/lib/logger/null_logger.rb
CHANGED
data/test/null_logger_test.rb
CHANGED
@@ -6,4 +6,24 @@ class NullLoggerTest < MiniTest::Unit::TestCase
|
|
6
6
|
logger = NullLogger.new
|
7
7
|
logger.add Logger::INFO, 'hi', 'tests'
|
8
8
|
end
|
9
|
+
|
10
|
+
def test_yields_when_block_given
|
11
|
+
logger = NullLogger.new
|
12
|
+
|
13
|
+
yielded = false
|
14
|
+
|
15
|
+
logger.debug('foo') { yielded = true ; 'message' }
|
16
|
+
|
17
|
+
assert yielded, 'Block not yielded'
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_does_not_yield_when_message_set
|
21
|
+
logger = NullLogger.new
|
22
|
+
|
23
|
+
yielded = false
|
24
|
+
|
25
|
+
logger.add(Logger::INFO, 'message') { yielded = true ; 'message' }
|
26
|
+
|
27
|
+
refute yielded, 'Block yielded'
|
28
|
+
end
|
9
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logger-better
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ahawkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|