Sha256: 8c92084d8d67e687a3421fed341c6f8a1f9d82d236b804b3c81106137f2fc7ea

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

# -*- coding: utf-8 -*-
$:.unshift File.expand_path File.join File.dirname(__FILE__), "../lib"
$:.unshift File.expand_path File.dirname(__FILE__)
$spec_dir = File.dirname(__FILE__)

require "rspec"
require "rack/test"
require "katakanaize"
require "nkf"

class TestRackApp
  #異なる文字コードのテキストを返すため
  def initialize(text)
    @body = text
  end

  def call(env)
    case env['PATH_INFO']
    when '/'
      [200, {"Content-Type" => "text/html"}, [@body]]
    when '/404'
      [404, {"Content-Type" => "image/jpg"}, [@body]]
    when '/image.jpg'
      [200, {"Content-Type" => "image/jpg"}, [@body]]
    end
  end
end






Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
katakanaize-0.0.3 spec/spec_helper.rb