This repository was archived by the owner on Dec 2, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +22
-34
lines changed Expand file tree Collapse file tree 5 files changed +22
-34
lines changed Original file line number Diff line number Diff line change 1
- require 'test/unit '
1
+ require 'minitest/autorun '
2
2
require 'mechanize'
3
- require 'rack/legacy'
4
- require 'rack/legacy/cgi'
5
3
6
- class CgiTest < Test ::Unit ::TestCase
4
+ class CgiTest < MiniTest ::Unit ::TestCase
7
5
8
6
def test_success
9
7
response = Mechanize . new . get 'http://localhost:4000/success.cgi'
@@ -67,13 +65,11 @@ def test_post
67
65
end
68
66
69
67
def test_flushing
70
- assert_nothing_raised do
71
- # 5 seconds should be enough to know it didn't lock up
72
- timeout 5 do
73
- response = Mechanize . new . get 'http://localhost:4000/flush.cgi'
74
- assert_equal '200' , response . code
75
- assert_equal 'text/html' , response . header [ 'content-type' ]
76
- end
68
+ # 5 seconds should be enough to know it didn't lock up
69
+ timeout 5 do
70
+ response = Mechanize . new . get 'http://localhost:4000/flush.cgi'
71
+ assert_equal '200' , response . code
72
+ assert_equal 'text/html' , response . header [ 'content-type' ]
77
73
end
78
74
end
79
75
Original file line number Diff line number Diff line change 1
- require 'test/unit'
2
-
3
- require 'rubygems'
1
+ require 'minitest/autorun'
4
2
require 'mechanize'
5
3
6
- require 'rack/legacy/php'
7
-
8
- class PhpTest < Test ::Unit ::TestCase
4
+ class PhpTest < MiniTest ::Unit ::TestCase
9
5
10
6
def test_success
11
7
response = Mechanize . new . get 'http://localhost:4000/success.php'
@@ -59,13 +55,11 @@ def test_post
59
55
end
60
56
61
57
def test_flushing
62
- assert_nothing_raised do
63
- # 5 seconds should be enough to know it didn't lock up
64
- timeout 5 do
65
- response = Mechanize . new . get 'http://localhost:4000/flush.php'
66
- assert_equal '200' , response . code
67
- assert_equal 'text/html' , response . header [ 'content-type' ]
68
- end
58
+ # 5 seconds should be enough to know it didn't lock up
59
+ timeout 5 do
60
+ response = Mechanize . new . get 'http://localhost:4000/flush.php'
61
+ assert_equal '200' , response . code
62
+ assert_equal 'text/html' , response . header [ 'content-type' ]
69
63
end
70
64
end
71
65
Original file line number Diff line number Diff line change 1
- # The unit tests do full end-to-end testing therefore a real server
2
- # needs to be run. Start this script before running the unit tests.
1
+ # The functional tests do full end-to-end testing therefore a real
2
+ # server needs to be run. Start this script before running the
3
+ # functional tests. The Rakefile does this automatically.
3
4
4
- require 'rubygems'
5
5
require 'webrick'
6
6
require 'rack'
7
7
require 'rack/showexceptions'
8
8
require 'rack/legacy'
9
- require 'rack/legacy/cgi'
10
- require 'rack/legacy/php'
11
9
12
10
# Keep WEBrick quiet for functional tests
13
11
class ::WEBrick ::HTTPServer ; def access_log ( config , req , res ) ; end end
Original file line number Diff line number Diff line change 1
- require 'test/unit'
2
- require 'flexmock/test_unit'
1
+ require 'minitest/autorun'
3
2
require 'rack/legacy'
4
3
require 'rack/legacy/cgi'
5
4
6
- class CgiTest < Test ::Unit ::TestCase
5
+ class CgiTest < MiniTest ::Unit ::TestCase
7
6
8
7
def test_valid?
9
8
assert app . valid? ( fixture_file ( 'success.cgi' ) ) # Valid file
Original file line number Diff line number Diff line change 1
- require 'test/unit'
1
+ require 'minitest/autorun'
2
+ require 'rack/legacy'
2
3
require 'rack/legacy/php'
3
4
4
- class PhpTest < Test ::Unit ::TestCase
5
+ class PhpTest < MiniTest ::Unit ::TestCase
5
6
6
7
def test_valid?
7
8
assert app . valid? ( 'success.php' ) # Valid file
You can’t perform that action at this time.
0 commit comments