tanga_services 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tanga_services/logger.rb +7 -0
- data/lib/tanga_services/version.rb +1 -1
- data/spec/logger_spec.rb +25 -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: f38deb61725a39955b707bf201ae366cef4e5aac
|
4
|
+
data.tar.gz: 562d25ec840601aaf6b626f14367c441ca157573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a25d7ad1d76ffeb3f7f740ce326f2cfee982c7ec66bc8e38becc406c38afc74ca93d0ceb3cfd3d03c25e6a3da4aeab3da99b854f0654f628db449bfa98ca2772
|
7
|
+
data.tar.gz: 48dc4c92e38ac7acfbb4d9a5ce6290b43b4730d0dbf84f9e9defa355768dbac866adb4774ce41afb091e99fc7032454584a21e9b0b518a69cd982cb6115f51da
|
data/spec/logger_spec.rb
CHANGED
@@ -14,6 +14,15 @@ describe TangaServices do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
context '.logger' do
|
18
|
+
it 'should give you access to logger' do
|
19
|
+
logger = instance_double(Syslog::Logger)
|
20
|
+
expect(Syslog::Logger).to receive(:new).with('my_app', Syslog::LOG_LOCAL7).and_return(logger)
|
21
|
+
TangaServices.logger.application_name = 'my_app'
|
22
|
+
expect(TangaServices.logger.logger).to be == logger
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
17
26
|
context '.log' do
|
18
27
|
it 'requires you log a hash' do
|
19
28
|
TangaServices.logger.application_name = 'app'
|
@@ -26,6 +35,22 @@ describe TangaServices do
|
|
26
35
|
raise_error(ArgumentError, "must have application_name set")
|
27
36
|
end
|
28
37
|
|
38
|
+
it '#write is an info, can be a string' do
|
39
|
+
logger = instance_double(Syslog::Logger)
|
40
|
+
expect(Syslog::Logger).to receive(:new).with('my_app', Syslog::LOG_LOCAL7).and_return(logger)
|
41
|
+
expect(logger).to receive(:info).with({level: :info, object: {message: 'hey there' } }.to_json)
|
42
|
+
TangaServices.logger.application_name = 'my_app'
|
43
|
+
TangaServices.logger.write('hey there')
|
44
|
+
end
|
45
|
+
|
46
|
+
it '#<< is an info, can be a string' do
|
47
|
+
logger = instance_double(Syslog::Logger)
|
48
|
+
expect(Syslog::Logger).to receive(:new).with('my_app', Syslog::LOG_LOCAL7).and_return(logger)
|
49
|
+
expect(logger).to receive(:info).with({level: :info, object: {message: 'hey there' } }.to_json)
|
50
|
+
TangaServices.logger.application_name = 'my_app'
|
51
|
+
TangaServices.logger << 'hey there'
|
52
|
+
end
|
53
|
+
|
29
54
|
%w( debug info warn error fatal ).each do |method|
|
30
55
|
it "should log #{ method}" do
|
31
56
|
logger = instance_double(Syslog::Logger)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tanga_services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Van Dyk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|