| Class | HelpTest |
| In: |
lib/ihelp.rb
|
| Parent: | Test::Unit::TestCase |
# File lib/ihelp.rb, line 1002
1002: def no_warn
1003: old_w = $-w
1004: $-w = nil
1005: yield
1006: $-w = old_w
1007: end
# File lib/ihelp.rb, line 1009
1009: def setup
1010: no_warn{
1011: Object.const_set("ARGV", ["--readline", "--prompt-mode", "simple"])
1012: }
1013: IHelp.instance_variable_set(
1014: :@ri_driver,
1015: IHelp::IHelpDriver.new([]))
1016: end
# File lib/ihelp.rb, line 1038
1038: def test_class_inherited_method_help
1039: assert(String.help_yaml(:map))
1040: end
# File lib/ihelp.rb, line 1034
1034: def test_class_method_help
1035: assert(String.help_yaml(:new))
1036: end
# File lib/ihelp.rb, line 1056
1056: def test_help_yamlings
1057: assert("string".help_yaml(:reverse) ==
1058: help_yaml("String#reverse"))
1059: assert(String.help_yaml(:new) ==
1060: help_yaml("String::new"))
1061: end
# File lib/ihelp.rb, line 1026
1026: def test_inherited_method_help
1027: assert("string".help_yaml(:map))
1028: end
# File lib/ihelp.rb, line 1049
1049: def test_method_constraints
1050: assert((not "string".help_yaml(:new,true)))
1051: assert((not "string".help_yaml(:reverse,false)))
1052: assert((not String.help_yaml(:new,true)))
1053: assert((not String.help_yaml(:reverse,false)))
1054: end
# File lib/ihelp.rb, line 1042
1042: def test_method_equalities
1043: assert(String.help_yaml(:new) ==
1044: "string".help_yaml(:new))
1045: assert(String.help_yaml(:reverse) ==
1046: "string".help_yaml(:reverse))
1047: end
# File lib/ihelp.rb, line 1022
1022: def test_method_help
1023: assert("string".help_yaml(:reverse))
1024: end
# File lib/ihelp.rb, line 1063
1063: def test_multipart_namespaces
1064: assert(Test::Unit.help_yaml)
1065: assert(help_yaml("Test::Unit"))
1066: assert(Test::Unit.help_yaml("run?"))
1067: assert(help_yaml("Test::Unit.run?"))
1068: assert(help_yaml("Test::Unit::run?"))
1069: assert(help_yaml("Test::Unit#run?"))
1070: end
# File lib/ihelp.rb, line 1072
1072: def test_not_found
1073: assert((NoHelp.help_yaml == nil))
1074: assert((String.help_yaml(:nonexistent) == nil))
1075: end