Class: OptionValueTest
- Defined in:
- lib/option_value.rb
Instance Method Summary collapse
- #test_for_hash_with_boolean ⇒ Object
- #test_for_hash_with_empty_array ⇒ Object
- #test_for_hash_with_empty_hash ⇒ Object
- #test_for_hash_with_integer ⇒ Object
- #test_for_hash_with_string ⇒ Object
- #test_for_yaml_with_boolean ⇒ Object
- #test_for_yaml_with_empty_value ⇒ Object
- #test_for_yaml_with_integer ⇒ Object
- #test_for_yaml_with_string ⇒ Object
Instance Method Details
#test_for_hash_with_boolean ⇒ Object
62 63 64 65 |
# File 'lib/option_value.rb', line 62 def test_for_hash_with_boolean assert_equal true, MarkdownExec::OptionValue.for_hash(true) assert_equal false, MarkdownExec::OptionValue.for_hash(false) end |
#test_for_hash_with_empty_array ⇒ Object
67 68 69 |
# File 'lib/option_value.rb', line 67 def test_for_hash_with_empty_array assert_equal [], MarkdownExec::OptionValue.for_hash([], 'default') end |
#test_for_hash_with_empty_hash ⇒ Object
71 72 73 |
# File 'lib/option_value.rb', line 71 def test_for_hash_with_empty_hash assert_equal({}, MarkdownExec::OptionValue.for_hash({}, 'default')) end |
#test_for_hash_with_integer ⇒ Object
58 59 60 |
# File 'lib/option_value.rb', line 58 def test_for_hash_with_integer assert_equal 42, MarkdownExec::OptionValue.for_hash(42) end |
#test_for_hash_with_string ⇒ Object
54 55 56 |
# File 'lib/option_value.rb', line 54 def test_for_hash_with_string assert_equal 'sample', MarkdownExec::OptionValue.for_hash('sample') end |
#test_for_yaml_with_boolean ⇒ Object
83 84 85 86 |
# File 'lib/option_value.rb', line 83 def test_for_yaml_with_boolean assert_equal true, MarkdownExec::OptionValue.for_yaml(true) assert_equal false, MarkdownExec::OptionValue.for_yaml(false) end |
#test_for_yaml_with_empty_value ⇒ Object
88 89 90 |
# File 'lib/option_value.rb', line 88 def test_for_yaml_with_empty_value assert_equal 'default', MarkdownExec::OptionValue.for_yaml([], 'default') end |
#test_for_yaml_with_integer ⇒ Object
79 80 81 |
# File 'lib/option_value.rb', line 79 def test_for_yaml_with_integer assert_equal 42, MarkdownExec::OptionValue.for_yaml(42) end |
#test_for_yaml_with_string ⇒ Object
75 76 77 |
# File 'lib/option_value.rb', line 75 def test_for_yaml_with_string assert_equal "'sample'", MarkdownExec::OptionValue.for_yaml('sample') end |