Skip to content

Instantly share code, notes, and snippets.

@ma11hew28
Created July 13, 2016 22:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ma11hew28/cdb76677ac4a76a4414bc566bf54d15c to your computer and use it in GitHub Desktop.
Save ma11hew28/cdb76677ac4a76a4414bc566bf54d15c to your computer and use it in GitHub Desktop.
Rack::Test Issue: Body shouldn't be a string
class App
def call(env)
[200, {'Content-Type' => 'text/plain'}, "Hello, World!"]
end
end
require './app'
run App.new
require './app'
require 'minitest/autorun'
require 'rack/test'
class AppTest < MiniTest::Test
include Rack::Test::Methods
def app
App.new
end
def test_body
get '/'
assert_equal "Hello, World!", last_response.body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment