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
999 1000 1001 1002 1003 1004 |
# File 'lib/ihelp.rb', line 999 def no_warn old_w = $-w $-w = nil yield $-w = old_w end |
#setup ⇒ Object
1006 1007 1008 1009 1010 1011 1012 1013 |
# File 'lib/ihelp.rb', line 1006 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
1027 1028 1029 |
# File 'lib/ihelp.rb', line 1027 def test_class_help assert(String.help_yaml) end |
#test_class_inherited_method_help ⇒ Object
1035 1036 1037 |
# File 'lib/ihelp.rb', line 1035 def test_class_inherited_method_help assert(String.help_yaml(:map)) end |
#test_class_method_help ⇒ Object
1031 1032 1033 |
# File 'lib/ihelp.rb', line 1031 def test_class_method_help assert(String.help_yaml(:new)) end |
#test_help_yamlings ⇒ Object
1053 1054 1055 1056 1057 1058 |
# File 'lib/ihelp.rb', line 1053 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
1023 1024 1025 |
# File 'lib/ihelp.rb', line 1023 def test_inherited_method_help assert("string".help_yaml(:map)) end |
#test_method_constraints ⇒ Object
1046 1047 1048 1049 1050 1051 |
# File 'lib/ihelp.rb', line 1046 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
1039 1040 1041 1042 1043 1044 |
# File 'lib/ihelp.rb', line 1039 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
1019 1020 1021 |
# File 'lib/ihelp.rb', line 1019 def test_method_help assert("string".help_yaml(:reverse)) end |
#test_multipart_namespaces ⇒ Object
1060 1061 1062 1063 1064 1065 1066 1067 |
# File 'lib/ihelp.rb', line 1060 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
1069 1070 1071 1072 |
# File 'lib/ihelp.rb', line 1069 def test_not_found assert((NoHelp.help_yaml == nil)) assert((String.help_yaml(:nonexistent) == nil)) end |
#test_simple_help ⇒ Object
1015 1016 1017 |
# File 'lib/ihelp.rb', line 1015 def test_simple_help assert("string".help_yaml) end |