Class: HelpTest
- Defined in:
- lib/ihelp.rb
Instance Method Summary collapse
- #no_warn ⇒ Object
- #setup ⇒ Object
- #test_class_help ⇒ Object
- #test_class_inherited_method_help ⇒ Object
- #test_class_method_help ⇒ Object
- #test_help_yamlings ⇒ Object
- #test_inherited_method_help ⇒ Object
- #test_method_constraints ⇒ Object
- #test_method_equalities ⇒ Object
- #test_method_help ⇒ Object
- #test_multipart_namespaces ⇒ Object
- #test_not_found ⇒ Object
- #test_simple_help ⇒ Object
Instance Method Details
#no_warn ⇒ Object
985 986 987 988 989 990 |
# File 'lib/ihelp.rb', line 985 def no_warn old_w = $-w $-w = nil yield $-w = old_w end |
#setup ⇒ Object
992 993 994 995 996 997 998 999 |
# File 'lib/ihelp.rb', line 992 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_help ⇒ Object
1013 1014 1015 |
# File 'lib/ihelp.rb', line 1013 def test_class_help assert(String.help_yaml) end |
#test_class_inherited_method_help ⇒ Object
1021 1022 1023 |
# File 'lib/ihelp.rb', line 1021 def test_class_inherited_method_help assert(String.help_yaml(:map)) end |
#test_class_method_help ⇒ Object
1017 1018 1019 |
# File 'lib/ihelp.rb', line 1017 def test_class_method_help assert(String.help_yaml(:new)) end |
#test_help_yamlings ⇒ Object
1039 1040 1041 1042 1043 1044 |
# File 'lib/ihelp.rb', line 1039 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_help ⇒ Object
1009 1010 1011 |
# File 'lib/ihelp.rb', line 1009 def test_inherited_method_help assert("string".help_yaml(:map)) end |
#test_method_constraints ⇒ Object
1032 1033 1034 1035 1036 1037 |
# File 'lib/ihelp.rb', line 1032 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_equalities ⇒ Object
1025 1026 1027 1028 1029 1030 |
# File 'lib/ihelp.rb', line 1025 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_help ⇒ Object
1005 1006 1007 |
# File 'lib/ihelp.rb', line 1005 def test_method_help assert("string".help_yaml(:reverse)) end |
#test_multipart_namespaces ⇒ Object
1046 1047 1048 1049 1050 1051 1052 1053 |
# File 'lib/ihelp.rb', line 1046 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_found ⇒ Object
1055 1056 1057 1058 |
# File 'lib/ihelp.rb', line 1055 def test_not_found assert((NoHelp.help_yaml == nil)) assert((String.help_yaml(:nonexistent) == nil)) end |
#test_simple_help ⇒ Object
1001 1002 1003 |
# File 'lib/ihelp.rb', line 1001 def test_simple_help assert("string".help_yaml) end |