Class: TC_TopLevel

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/carat-dev/main/tc_toplevel.rb,
lib/carat-dev/main/toplevel_test.rb

Overview

## ## ##

####     ##    ##
##        ##   ##
#####  ####    ##

Instance Method Summary collapse

Instance Method Details

#test_compareObject



14
15
16
17
18
19
20
21
# File 'lib/carat-dev/main/tc_toplevel.rb', line 14

def test_compare
  assert_equal( TOPLEVEL_BINDING.self , TOPLEVEL_BINDING.self )
  assert_equal( toplevel , toplevel )
  assert_equal( TOPLEVEL , TOPLEVEL )
  assert_equal( TOPLEVEL , toplevel )
  assert_instance_of( TopLevel, toplevel )
  assert_eqaul( Object, toplevel.class )
end

#test_instanceObject



9
10
11
12
13
# File 'lib/carat-dev/main/toplevel_test.rb', line 9

def test_instance
  assert_nothing_raised do
    @t = toplevel
  end
end

#test_instance_varsObject



19
20
21
# File 'lib/carat-dev/main/toplevel_test.rb', line 19

def test_instance_vars
  assert_equal(['@x'], toplevel.self.instance_variables)
end

#test_local_varsObject



15
16
17
# File 'lib/carat-dev/main/toplevel_test.rb', line 15

def test_local_vars
  assert_equal(['a'], toplevel.local_variables)
end