spec/adhearsion/logging_spec.rb in adhearsion-2.6.4 vs spec/adhearsion/logging_spec.rb in adhearsion-3.0.0.beta1
- old
+ new
@@ -55,22 +55,12 @@
it "initializes properly a Logging object" do
expect(::Logging.logger.root.appenders.length).to eql(1)
expect(::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::Stdout)}.length).to eql(1)
end
- it "initializes properly a Logging object with appenders as parameter" do
- Adhearsion::Logging.start([::Logging.appenders.stdout, ::Logging.appenders.file('example.log')])
- expect(::Logging.logger.root.appenders.length).to eql(2)
- expect(::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::Stdout)}.length).to eql(1)
- expect(::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::File)}.length).to eql(1)
- end
-
- it "initializes properly a Logging object with appenders and log level as parameter" do
- Adhearsion::Logging.start([::Logging.appenders.stdout, ::Logging.appenders.file('example.log')], :debug)
- expect(::Logging.logger.root.appenders.length).to eql(2)
- expect(::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::Stdout)}.length).to eql(1)
- expect(::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::File)}.length).to eql(1)
+ it "initializes properly a Logging object with log level as parameter" do
+ Adhearsion::Logging.start(:debug)
expect(::Logging.logger.root.level).to eql(::Logging::LEVELS["debug"])
end
it "should create only a Logging object per Class (reuse per all the instances)" do
_logger = Foo.new.logger
@@ -83,23 +73,18 @@
_foo_logger = Foo.new.logger
_bar_logger = Foo::Bar.new.logger
expect(_foo_logger.object_id).not_to eql(_bar_logger)
end
- it 'should reopen logfiles' do
- expect(::Logging).to receive(:reopen).once
- Adhearsion::Logging.reopen_logs
- end
-
it 'should toggle between :trace and the configured log level' do
- orig_level = Adhearsion.config.platform.logging['level']
- Adhearsion.config.platform.logging['level'] = :warn
+ orig_level = Adhearsion.config.core.logging['level']
+ Adhearsion.config.core.logging['level'] = :warn
Adhearsion::Logging.level = :warn
Adhearsion::Logging.toggle_trace!
expect(Adhearsion::Logging.level).to eq(0)
Adhearsion::Logging.toggle_trace!
expect(Adhearsion::Logging.level).to eq(3)
- Adhearsion.config.platform.logging['level'] = orig_level
+ Adhearsion.config.core.logging['level'] = orig_level
end
describe 'level changing' do
before { Adhearsion::Logging.unsilence! }