|
22 | 22 |
|
23 | 23 | module SharedHelpers |
24 | 24 |
|
25 | | - java_import 'org.jruby.rack.RackContext' |
26 | | - java_import 'org.jruby.rack.RackConfig' |
27 | | - java_import 'org.jruby.rack.servlet.ServletRackContext' |
28 | | - java_import 'javax.servlet.ServletContext' |
29 | | - java_import 'javax.servlet.ServletConfig' |
30 | | - |
31 | 25 | def mock_servlet_context |
32 | | - @servlet_context = ServletContext.impl {} |
33 | | - @rack_config ||= RackConfig.impl {} |
34 | | - @rack_context ||= ServletRackContext.impl {} |
| 26 | + @servlet_context = Java::JavaxServlet::ServletContext.impl {} |
| 27 | + @rack_config ||= Java::OrgJrubyRack::RackConfig.impl {} |
| 28 | + @rack_context ||= Java::OrgJrubyRackServlet::ServletRackContext.impl {} |
35 | 29 | [@rack_context, @servlet_context].each do |context| |
36 | 30 | allow(context).to receive(:log) |
37 | 31 | allow(context).to receive(:isEnabled).and_return nil |
38 | 32 | allow(context).to receive(:getInitParameter).and_return nil |
39 | 33 | allow(context).to receive(:getRealPath).and_return "/" |
40 | 34 | allow(context).to receive(:getResource).and_return nil |
41 | 35 | allow(context).to receive(:getContextPath).and_return "/" |
| 36 | + allow(context).to receive(:init_parameter_names).and_return [] |
42 | 37 | end |
43 | 38 | allow(@rack_context).to receive(:getConfig).and_return @rack_config |
44 | | - @servlet_config ||= ServletConfig.impl {} |
| 39 | + @servlet_config ||= Java::JavaxServlet::ServletConfig.impl {} |
45 | 40 | allow(@servlet_config).to receive(:getServletName).and_return "a Servlet" |
46 | 41 | allow(@servlet_config).to receive(:getServletContext).and_return @servlet_context |
47 | 42 | @servlet_context |
@@ -151,8 +146,8 @@ def should_eval_as_not_nil(code) |
151 | 146 |
|
152 | 147 | config.backtrace_exclusion_patterns = [ |
153 | 148 | /bin\//, |
154 | | - #/gems/, |
155 | | - /spec\/spec_helper\.rb/, |
| 149 | + # /gems/, |
| 150 | + # /spec\/spec_helper\.rb/, |
156 | 151 | ] |
157 | 152 |
|
158 | 153 | end |
|
0 commit comments