Class: OptionValueTest

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/option_value.rb

Instance Method Summary collapse

Instance Method Details

#test_for_hash_with_booleanObject



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_arrayObject



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_hashObject



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_integerObject



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_stringObject



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_booleanObject



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_valueObject



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_integerObject



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_stringObject



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