aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/cgi_test.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-06-25 12:12:30 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-06-25 12:12:30 +0100
commit01571c0fd73a31f78411d6cad6484ddd82ec4778 (patch)
treed0565f7ad3fd5a65aafbf191170094b90d7ef543 /actionpack/test/controller/cgi_test.rb
parentb5e9badea281ce0c371ff1c00461febe66f4e2b2 (diff)
parent670e22e3724791f51d639f409930fba5af920081 (diff)
downloadrails-01571c0fd73a31f78411d6cad6484ddd82ec4778.tar.gz
rails-01571c0fd73a31f78411d6cad6484ddd82ec4778.tar.bz2
rails-01571c0fd73a31f78411d6cad6484ddd82ec4778.zip
Merge commit 'mainstream/master'
Conflicts: actionpack/lib/action_view/helpers/javascript_helper.rb activesupport/lib/active_support/dependencies.rb activesupport/lib/active_support/inflector.rb activesupport/lib/active_support/values/time_zone.rb
Diffstat (limited to 'actionpack/test/controller/cgi_test.rb')
-rwxr-xr-xactionpack/test/controller/cgi_test.rb50
1 files changed, 26 insertions, 24 deletions
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb
index f0f3a4b826..1b1ded4615 100755
--- a/actionpack/test/controller/cgi_test.rb
+++ b/actionpack/test/controller/cgi_test.rb
@@ -115,35 +115,37 @@ class CgiRequestNeedsRewoundTest < BaseCgiTest
end
end
-class CgiResponseTest < BaseCgiTest
- def setup
- super
- @fake_cgi.expects(:header).returns("HTTP/1.0 200 OK\nContent-Type: text/html\n")
- @response = ActionController::CgiResponse.new(@fake_cgi)
- @output = StringIO.new('')
- end
-
- def test_simple_output
- @response.body = "Hello, World!"
+uses_mocha 'CGI Response' do
+ class CgiResponseTest < BaseCgiTest
+ def setup
+ super
+ @fake_cgi.expects(:header).returns("HTTP/1.0 200 OK\nContent-Type: text/html\n")
+ @response = ActionController::CgiResponse.new(@fake_cgi)
+ @output = StringIO.new('')
+ end
- @response.out(@output)
- assert_equal "HTTP/1.0 200 OK\nContent-Type: text/html\nHello, World!", @output.string
- end
+ def test_simple_output
+ @response.body = "Hello, World!"
- def test_head_request
- @fake_cgi.env_table['REQUEST_METHOD'] = 'HEAD'
- @response.body = "Hello, World!"
+ @response.out(@output)
+ assert_equal "HTTP/1.0 200 OK\nContent-Type: text/html\nHello, World!", @output.string
+ end
- @response.out(@output)
- assert_equal "HTTP/1.0 200 OK\nContent-Type: text/html\n", @output.string
- end
+ def test_head_request
+ @fake_cgi.env_table['REQUEST_METHOD'] = 'HEAD'
+ @response.body = "Hello, World!"
- def test_streaming_block
- @response.body = Proc.new do |response, output|
- 5.times { |n| output.write(n) }
+ @response.out(@output)
+ assert_equal "HTTP/1.0 200 OK\nContent-Type: text/html\n", @output.string
end
- @response.out(@output)
- assert_equal "HTTP/1.0 200 OK\nContent-Type: text/html\n01234", @output.string
+ def test_streaming_block
+ @response.body = Proc.new do |response, output|
+ 5.times { |n| output.write(n) }
+ end
+
+ @response.out(@output)
+ assert_equal "HTTP/1.0 200 OK\nContent-Type: text/html\n01234", @output.string
+ end
end
end