Skip to content

Commit

Permalink
another fix for #292
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiii committed Jun 7, 2012
1 parent 6297215 commit 1eb17ea
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/savon/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def logger=(logger)
end

def log_level=(level)
_logger.level = log_level
_logger.level = level
end

def log=(log)
Expand Down
34 changes: 26 additions & 8 deletions spec/savon/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,37 @@

describe Savon::Config do

describe "#clone" do
subject do
config = Savon::Config.new
config._logger = Savon::Logger.new
config
end
let(:config) {
config = Savon::Config.new
config._logger = Savon::Logger.new
config
}

describe "#clone" do
it "clones the logger" do
logger = subject.logger
clone = subject.clone
logger = config.logger
clone = config.clone

logger.should_not equal(clone.logger)
end
end

it "allows to change the logger" do
logger = Logger.new("/dev/null")
config.logger = logger
config._logger.subject.should equal(logger)
end

it "allows to change the log level" do
config.log_level = :info
config._logger.level.should == :info
end

it "allows to enable/disable logging" do
config.log = false
config._logger.should be_a(Savon::NullLogger)
config.log = true
config._logger.should be_a(Savon::Logger)
end

end

0 comments on commit 1eb17ea

Please sign in to comment.