Skip to content

Commit

Permalink
Testing hello world.
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Mar 12, 2011
1 parent d1f56cd commit 133b3cd
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
source "http://rubygems.org"

gem "sinatra"

group :development, :test do

gem 'rack-test'
end
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ GEM
remote: http://rubygems.org/
specs:
rack (1.2.1)
rack-test (0.5.7)
rack (>= 1.0)
sinatra (1.2.0)
rack (~> 1.1)
tilt (>= 1.2.2, < 2.0)
Expand All @@ -11,4 +13,5 @@ PLATFORMS
ruby

DEPENDENCIES
rack-test
sinatra
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'rake/testtask'
Rake::TestTask.new do |t|
t.pattern = "test/*_test.rb"
end
4 changes: 0 additions & 4 deletions rstatus.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
require "rubygems"
require 'bundler'
Bundler.setup

require 'sinatra/base'

class Rstatus < Sinatra::Base
Expand Down
15 changes: 15 additions & 0 deletions test/rstatus_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require_relative 'test_helper'

class RstatusTest < MiniTest::Unit::TestCase

include Rack::Test::Methods

def app() Rstatus end

def test_hello_world
get '/'
assert last_response.ok?
assert_equal "Hello, world!", last_response.body
end
end

6 changes: 6 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ENV['RACK_ENV'] = 'test'
require 'minitest/autorun'
require 'rack/test'

require_relative '../rstatus'

0 comments on commit 133b3cd

Please sign in to comment.