- Revision
- 246
- Author
- mward
- Date
- 2007-07-09 09:35:47 -0500 (Mon, 09 Jul 2007)
Log Message
added specs for waffle::context
Modified Paths
- trunk/core/src/main/java/org/codehaus/waffle/context/pico/PicoComponentRegistry.java
- trunk/core/src/main/java/org/codehaus/waffle/servlet/RhtmlServlet.java
- trunk/core/src/test/specs/org/codehaus/waffle/servlet/waffle_spec.rb
- trunk/plugins/rspec-maven-plugin/src/main/java/org/codehaus/waffle/mojo/RspecRunnerMojo.java
Diff
Modified: trunk/core/src/main/java/org/codehaus/waffle/context/pico/PicoComponentRegistry.java (245 => 246)
--- trunk/core/src/main/java/org/codehaus/waffle/context/pico/PicoComponentRegistry.java 2007-07-09 14:35:08 UTC (rev 245) +++ trunk/core/src/main/java/org/codehaus/waffle/context/pico/PicoComponentRegistry.java 2007-07-09 14:35:47 UTC (rev 246) @@ -10,12 +10,7 @@ *****************************************************************************/ package org.codehaus.waffle.context.pico; -import java.util.Enumeration; - -import javax.servlet.ServletContext; - import ognl.TypeConverter; - import org.codehaus.waffle.ComponentRegistry; import org.codehaus.waffle.WaffleException; import org.codehaus.waffle.action.ActionMethodExecutor; @@ -57,6 +52,9 @@ import org.picocontainer.defaults.ConstructorInjectionComponentAdapter; import org.picocontainer.defaults.DefaultPicoContainer; +import javax.servlet.ServletContext; +import java.util.Enumeration; + /** * PicoContainer-based implementation of Waffle's ComponentRegistry * @@ -128,8 +126,8 @@ * <p/> * <code> * <context-param> - * <param-name>org.codehaus.waffle.actions.ControllerDefinitionFactory</param-name> - * <param-value>org.myurl.FooBarControllerFactory</param-value> + * <param-name>org.codehaus.waffle.actions.ControllerDefinitionFactory</param-name> + * <param-value>org.myurl.FooBarControllerFactory</param-value> * </context-param> * </code> *
Modified: trunk/core/src/main/java/org/codehaus/waffle/servlet/RhtmlServlet.java (245 => 246)
--- trunk/core/src/main/java/org/codehaus/waffle/servlet/RhtmlServlet.java 2007-07-09 14:35:08 UTC (rev 245) +++ trunk/core/src/main/java/org/codehaus/waffle/servlet/RhtmlServlet.java 2007-07-09 14:35:47 UTC (rev 246) @@ -25,9 +25,9 @@ * @author Fabio Kung */ public class RhtmlServlet extends HttpServlet { + @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String template = loadRhtml(request.getServletPath()); Ruby runtime = RequestLevelContainer.get().getComponentInstanceOfType(Ruby.class);
Modified: trunk/core/src/test/specs/org/codehaus/waffle/servlet/waffle_spec.rb (245 => 246)
--- trunk/core/src/test/specs/org/codehaus/waffle/servlet/waffle_spec.rb 2007-07-09 14:35:08 UTC (rev 245) +++ trunk/core/src/test/specs/org/codehaus/waffle/servlet/waffle_spec.rb 2007-07-09 14:35:47 UTC (rev 246) @@ -1,4 +1,5 @@ require 'org/codehaus/waffle/waffle' +require 'ostruct' include_class 'java.util.Hashtable' @@ -46,7 +47,16 @@ waffle_context.include?('foo').should == true waffle_context.include?(:bar).should == true + end + it "should delegate method calls to the underlying instance when method is missing" do + context = mock('the mock') + context.should_receive(:get_attribute_names).and_return(OpenStruct.new) + context.should_receive(:foo).with('bar').and_return('success') + + waffle_context = Waffle::WebContext.new(context) + + waffle_context.foo('bar').should == "success" end end \ No newline at end of file
Modified: trunk/plugins/rspec-maven-plugin/src/main/java/org/codehaus/waffle/mojo/RspecRunnerMojo.java (245 => 246)
--- trunk/plugins/rspec-maven-plugin/src/main/java/org/codehaus/waffle/mojo/RspecRunnerMojo.java 2007-07-09 14:35:08 UTC (rev 245) +++ trunk/plugins/rspec-maven-plugin/src/main/java/org/codehaus/waffle/mojo/RspecRunnerMojo.java 2007-07-09 14:35:47 UTC (rev 246) @@ -44,7 +44,7 @@ /** * The directory where JRuby is installed (defaults to ~/.jruby) * - * @parameter + * @parameter _expression_="${jruby.home}" */ protected String jrubyHome; @@ -93,7 +93,11 @@ throw new MojoFailureException("RSpec failure"); } + getLog().info(""); + getLog().info("------------------------------------------------------------------------"); getLog().info("RSPEC TESTS SUCCESSFUL"); + getLog().info("------------------------------------------------------------------------"); + getLog().info(""); } private String handleClasspathElements(JavaSupport javaSupport) throws MalformedURLException {
To unsubscribe from this list please visit:
