macmillan-utils 1.0.39 → 1.0.40
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 035e98cbc71c2bebdd28ae144cbcd2f67d4b4271
|
4
|
+
data.tar.gz: 74d77b9604b18e7e0587c5b369197d9cb9273fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2787195fab5f2524f0d886f488580ea2f0b791d0f01e9f96fe2d4429d793d89be50003e97200c86c2a694c21553aef4b2498698e3d47ce16239fa0e4fb313ec
|
7
|
+
data.tar.gz: b06b8e063a31ca8044e10fc8e9ab12b15e53011da44b4307dca0388185f93eb12adb8d6ebdae17200fa6569de7f5f642ff520189166d7686ceb4eafbea95bc0b
|
@@ -17,22 +17,27 @@ describe Macmillan::Utils::Logger::Formatter do
|
|
17
17
|
it 'is called by the logger object' do
|
18
18
|
expect(target).to receive(:write).once
|
19
19
|
expect(subject).to receive(:call).once
|
20
|
-
logger.info
|
20
|
+
logger.info('this is a test')
|
21
21
|
end
|
22
22
|
|
23
23
|
context 'when a prefix is set' do
|
24
|
-
let(:prefix)
|
24
|
+
let(:prefix) { 'WEEEE' }
|
25
|
+
let(:level_prefix) { '[ INFO]:' }
|
26
|
+
let(:suffix) { "\n" }
|
25
27
|
|
26
|
-
it '
|
27
|
-
expect(target).to receive(:write).with("#{prefix}
|
28
|
-
logger.info
|
28
|
+
it 'appears in front of the log message, and the expected suffix applies' do
|
29
|
+
expect(target).to receive(:write).with("#{prefix} #{level_prefix} #{msg}#{suffix}").once
|
30
|
+
logger.info(msg)
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
32
34
|
context 'when the log message is a string' do
|
33
|
-
|
34
|
-
|
35
|
-
|
35
|
+
let(:level_prefix) { '[ INFO]:' }
|
36
|
+
let(:suffix) { "\n" }
|
37
|
+
|
38
|
+
it 'returns the string prefixed and suffixed appropriately' do
|
39
|
+
expect(target).to receive(:write).with("#{level_prefix} #{msg}#{suffix}").once
|
40
|
+
logger.info(msg)
|
36
41
|
end
|
37
42
|
end
|
38
43
|
|
@@ -41,7 +46,7 @@ describe Macmillan::Utils::Logger::Formatter do
|
|
41
46
|
ex = StandardError.new('qwerty')
|
42
47
|
allow(ex).to receive(:backtrace).and_return(%w(foo bar baz quux))
|
43
48
|
expect(target).to receive(:write).with("[ INFO]: qwerty (StandardError)\nfoo\nbar\nbaz\nquux").once
|
44
|
-
logger.info
|
49
|
+
logger.info(ex)
|
45
50
|
end
|
46
51
|
end
|
47
52
|
|
@@ -49,8 +54,7 @@ describe Macmillan::Utils::Logger::Formatter do
|
|
49
54
|
it 'retuns object.inspect' do
|
50
55
|
ex = []
|
51
56
|
expect(ex).to receive(:inspect).once
|
52
|
-
|
53
|
-
logger.info ex
|
57
|
+
logger.info(ex)
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macmillan-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Springer Nature
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|