Permalink
Browse files

Fix whitespace errors across all source files and tests

I can't stand this shit anymore.
  • Loading branch information...
rtomayko committed Aug 31, 2008
1 parent 7be3682 commit 60d50062d7a39981942f907fc50a82d48989778b
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,7 +1,7 @@
module Sinatra
-
+
module Test
-
+
module Methods
def easy_env_map
@@ -13,12 +13,12 @@ def easy_env_map
:cookies => "HTTP_COOKIE"
}
end
-
+
def session(data, key = 'rack.session')
data = data.from_params if data.respond_to?(:from_params)
"#{Rack::Utils.escape(key)}=#{[Marshal.dump(data)].pack("m*")}"
end
-
+
def map_easys(params)
easy_env_map.inject(params.dup) do |m, (from, to)|
m[to] = m.delete(from) if m.has_key?(from); m
@@ -37,17 +37,17 @@ def map_easys(params)
@response = @request.request(m.upcase, path, {:input => input}.merge(env || {}))
end
end
-
+
def follow!
get_it(@response.location)
end
def method_missing(name, *args)
@response.send(name, *args) rescue super
end
-
+
end
end
-
+
end
View
@@ -2,9 +2,9 @@
require 'test/spec'
class Test::Unit::TestCase
-
+
def should
@response.should
end
-
+
end
View
@@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/helper'
context "Sinatra" do
-
+
setup do
Sinatra.application = nil
end
@@ -17,32 +17,32 @@
get '/' do
nil
end
-
+
get_it '/'
should.be.ok
body.should == ''
end
-
+
specify "handles events" do
get '/:name' do
'Hello ' + params["name"]
end
-
+
get_it '/Blake'
-
+
should.be.ok
body.should.equal 'Hello Blake'
end
-
+
specify "handles splats" do
get '/hi/*' do
params["splat"].kind_of?(Array).should.equal true
params["splat"].first
end
-
+
get_it '/hi/Blake'
-
+
should.be.ok
body.should.equal 'Blake'
end
@@ -51,9 +51,9 @@
get '/say/*/to/*' do
params["splat"].join(' ')
end
-
+
get_it '/say/hello/to/world'
-
+
should.be.ok
body.should.equal 'hello world'
end
@@ -62,14 +62,14 @@
get '/say/*/to*/*' do
params["splat"].join(' ')
end
-
+
get_it '/say/hello/to/world'
-
+
should.be.ok
body.should.equal 'hello world' # second splat is empty
get_it '/say/hello/tomy/world'
-
+
should.be.ok
body.should.equal 'hello my world'
end
@@ -93,20 +93,20 @@
get '/' do
redirect '/blake'
end
-
+
get '/blake' do
'Mizerany'
end
-
+
get_it '/'
should.be.redirection
body.should.equal ''
-
+
follow!
should.be.ok
body.should.equal 'Mizerany'
end
-
+
specify "renders a body with a redirect" do
Sinatra::EventContext.any_instance.expects(:foo).returns('blah')
get "/" do
@@ -130,34 +130,34 @@
end
specify "body sets content and ends event" do
-
+
Sinatra::EventContext.any_instance.expects(:foo).never
-
+
get '/set_body' do
stop 'Hello!'
stop 'World!'
foo
end
-
+
get_it '/set_body'
-
+
should.be.ok
body.should.equal 'Hello!'
-
+
end
-
+
specify "should set status then call helper with a var" do
Sinatra::EventContext.any_instance.expects(:foo).once.with(1).returns('bah!')
-
+
get '/set_body' do
stop [404, [:foo, 1]]
end
-
+
get_it '/set_body'
-
+
should.be.not_found
body.should.equal 'bah!'
-
+
end
specify "should easily set response Content-Type" do
@@ -235,7 +235,7 @@
body.should.equal ''
end
-
+
specify "put'n with POST" do
put '/' do
'puted'
@@ -252,7 +252,7 @@
assert_equal 'puted', body
end
- # Some Ajax libraries downcase the _method parameter value. Make
+ # Some Ajax libraries downcase the _method parameter value. Make
# sure we can handle that.
specify "put'n with POST and lowercase _method param" do
put '/' do
Oops, something went wrong.

0 comments on commit 60d5006

Please sign in to comment.