Skip to content

Commit 7b0d3b1

Browse files
committed
[test] a less stubbed spec for ServletLog
1 parent 927586c commit 7b0d3b1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/spec/ruby/jruby/rack/logger_spec.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,18 @@
116116
end
117117

118118
describe JRuby::Rack::ServletLog do
119+
let(:servlet_context_logger) do
120+
org.jruby.rack.logging.ServletContextLogger.new(servlet_context)
121+
end
119122

120123
it "writes messages to the servlet context" do
121-
JRuby::Rack.context = rack_context = double('context')
124+
JRuby::Rack.context = servlet_context_logger
122125
servlet_log = JRuby::Rack.send(:servlet_log)
123-
rack_context.should_receive(:log).with(/hello/)
124126
servlet_log.write "hello"
125-
rack_context.should_receive(:log).with(/hoja!/)
127+
expect(real_logger.logged_content).to match(/hello/)
126128
servlet_log.puts "hoja!hoj"
129+
expect(real_logger.logged_content).to match(/hoja!/)
127130
servlet_log.close
128131
end
129-
130132
end
131-
132133
end

0 commit comments

Comments
 (0)