-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from dbyron0/pass_logger_to_serverengine
Give serverengine the same logger object sneakers uses. Avoid problems ...
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'logger' | ||
require 'spec_helper' | ||
require 'sneakers' | ||
|
||
describe Sneakers::Runner do | ||
let(:logger) { Logger.new('logtest.log') } | ||
|
||
describe "with configuration that specifies a logger object" do | ||
before do | ||
Sneakers.configure(log: logger) | ||
@runner = Sneakers::Runner.new([]) | ||
end | ||
|
||
it 'passes the logger to serverengine' do | ||
# Stub out ServerEngine::Daemon.run so we only exercise the way we invoke | ||
# ServerEngine.create | ||
any_instance_of(ServerEngine::Daemon) do |daemon| | ||
stub(daemon).main{ return 0 } | ||
end | ||
|
||
@runner.run | ||
# look at @runner's @se instance variable (actually of type Daemon)...and | ||
# figure out what it's logger is... | ||
end | ||
end | ||
end |