Class: Web::Unit::TestCase

Inherits:
Object show all
Includes:
Web::Unit, Utils
Defined in:
lib/web/unit/testcase.rb

Constant Summary

Constants included from Web::Unit

AVAILABLE_FRAMEWORKS, AVAILABLE_XMLPARSERS, BOUNDARY, USING_XMLPARSER

Instance Method Summary collapse

Methods included from Utils

#complete_url, #orthop_url, #parse_url

Methods included from Web::Unit

#assert_attrs, #assert_include, #assert_input, #assert_select_option, #assert_title, #assert_urls, dispatch, runtest

Constructor Details

#initialize(method, name = self.class.name) ⇒ TestCase

Returns a new instance of TestCase.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/web/unit/testcase.rb', line 17

def initialize( method, name=self.class.name )
  case USING_FRAMEWORK
  when 'Test::Unit'
    super(method)
  when 'RubyUnit'
    super
  else
    super
    # raise??
  end
  @urlbase = ENV['URLBASE'] ? ENV['URLBASE'] : 'http://localhost/'
  @urlbase = orthop_url( @urlbase )
  @urlbase << '/' unless @urlbase =~ %r!/$!
  $stderr.puts "URLBASE is #{@urlbase}" if $DEBUG
end

Instance Method Details

#setupObject



33
34
35
36
37
# File 'lib/web/unit/testcase.rb', line 33

def setup
  $URLBASE = @urlbase
  Response::reset
  @cookies_kept = Cookies::instance.cookies
end

#teardownObject



39
40
41
42
# File 'lib/web/unit/testcase.rb', line 39

def teardown
  Response::reset
  Cookies::instance.cookies = @cookies_kept
end

#test_make_testunit_stop_complaining_about_no_testsObject



44
45
46
# File 'lib/web/unit/testcase.rb', line 44

def test_make_testunit_stop_complaining_about_no_tests

end