Class: HelpTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/ihelp.rb

Instance Method Summary collapse

Instance Method Details

#no_warnObject



1003
1004
1005
1006
1007
1008
# File 'lib/ihelp.rb', line 1003

def no_warn
  old_w = $-w
  $-w = nil
  yield
  $-w = old_w
end

#setupObject



1010
1011
1012
1013
1014
1015
1016
1017
# File 'lib/ihelp.rb', line 1010

def setup
  no_warn{
    Object.const_set("ARGV", ["--readline", "--prompt-mode", "simple"])
  }
  IHelp.instance_variable_set(
    :@ri_driver,
    IHelp::IHelpDriver.new(IHelp::RI_ARGS))
end

#test_class_helpObject



1031
1032
1033
# File 'lib/ihelp.rb', line 1031

def test_class_help
  assert(String.help_yaml)
end

#test_class_inherited_method_helpObject



1039
1040
1041
# File 'lib/ihelp.rb', line 1039

def test_class_inherited_method_help
  assert(String.help_yaml(:map))
end

#test_class_method_helpObject



1035
1036
1037
# File 'lib/ihelp.rb', line 1035

def test_class_method_help
  assert(String.help_yaml(:new))
end

#test_help_yamlingsObject



1057
1058
1059
1060
1061
1062
# File 'lib/ihelp.rb', line 1057

def test_help_yamlings
  assert("string".help_yaml(:reverse) ==
         help_yaml("String#reverse"))
  assert(String.help_yaml(:new) ==
         help_yaml("String::new"))
end

#test_inherited_method_helpObject



1027
1028
1029
# File 'lib/ihelp.rb', line 1027

def test_inherited_method_help
  assert("string".help_yaml(:map))
end

#test_method_constraintsObject



1050
1051
1052
1053
1054
1055
# File 'lib/ihelp.rb', line 1050

def test_method_constraints
  assert((not "string".help_yaml(:new,true)))
  assert((not "string".help_yaml(:reverse,false)))
  assert((not String.help_yaml(:new,true)))
  assert((not String.help_yaml(:reverse,false)))
end

#test_method_equalitiesObject



1043
1044
1045
1046
1047
1048
# File 'lib/ihelp.rb', line 1043

def test_method_equalities
  assert(String.help_yaml(:new) ==
         "string".help_yaml(:new))
  assert(String.help_yaml(:reverse) ==
         "string".help_yaml(:reverse))
end

#test_method_helpObject



1023
1024
1025
# File 'lib/ihelp.rb', line 1023

def test_method_help
  assert("string".help_yaml(:reverse))
end

#test_multipart_namespacesObject



1064
1065
1066
1067
1068
1069
1070
1071
# File 'lib/ihelp.rb', line 1064

def test_multipart_namespaces
  assert(Test::Unit.help_yaml)
  assert(help_yaml("Test::Unit"))
  assert(Test::Unit.help_yaml("run?"))
  assert(help_yaml("Test::Unit.run?"))
  assert(help_yaml("Test::Unit::run?"))
  assert(help_yaml("Test::Unit#run?"))
end

#test_not_foundObject



1073
1074
1075
1076
# File 'lib/ihelp.rb', line 1073

def test_not_found
  assert((NoHelp.help_yaml == nil))
  assert((String.help_yaml(:nonexistent) == nil))
end

#test_simple_helpObject



1019
1020
1021
# File 'lib/ihelp.rb', line 1019

def test_simple_help
  assert("string".help_yaml)
end