Package com.squareup.rack

Examples of com.squareup.rack.RackInput


import static org.mockito.Mockito.when;

public class JRubyRackInputTest {
  @Test public void shouldWrapJavaIOExceptions() throws Exception {
    Ruby ruby = Ruby.newInstance();
    RackInput rackInput = mock(RackInput.class);
    when(rackInput.read(null)).thenThrow(new IOException("fake"));

    JRubyRackInput subject = new JRubyRackInput(ruby, rackInput);
    GlobalVariables globalVariables = ruby.getGlobalVariables();
    globalVariables.set("$rack_input", subject);
View Full Code Here


    return new RackEnvironment(content.build());
  }

  private RackInput rackInput(HttpServletRequest request) {
    try {
      return new RackInput(new TempfileBufferedInputStream(request.getInputStream()));
    } catch (IOException e) {
      throw propagate(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.squareup.rack.RackInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.