Sha256: 2060d5334956619e25712235d7323f103510de03f9899ee6cf53477cf1bd42e8

Contents?: true

Size: 897 Bytes

Versions: 3

Compression:

Stored size: 897 Bytes

Contents

# frozen_string_literal: true

require 'pork/auto'
require 'muack'
require 'jellyfish'
require 'rack'

Pork::Suite.include(Muack::API)

copy :jellyfish do
  module_eval(%w[options get head post put delete patch].map{ |method|
    <<-RUBY
      def #{method} path='/', a=app, env={}
        File.open(File::NULL) do |input|
          a.call({'PATH_INFO'      => path              ,
                  'REQUEST_METHOD' => '#{method}'.upcase,
                  'SCRIPT_NAME'    => ''                ,
                  'rack.input'     => input             ,
                  'rack.url_scheme'=> 'http'            ,
                  'SERVER_NAME'    => 'localhost'       ,
                  'SERVER_PORT'    => '8080'}.merge(env))
        end
      end
    RUBY
  }.join("\n"))
end

copy :stringio do
  def new_stringio
    sock = StringIO.new
    sock.set_encoding('ASCII-8BIT')
    sock
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jellyfish-1.4.0 lib/jellyfish/test.rb
jellyfish-1.3.1 lib/jellyfish/test.rb
jellyfish-1.3.0 lib/jellyfish/test.rb