Class: MarkdownExec::TestHashDelegatorBlockFind
- Defined in:
- lib/hash_delegator.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_block_find_with_default ⇒ Object
- #test_block_find_with_match ⇒ Object
- #test_block_find_without_match ⇒ Object
Instance Method Details
#setup ⇒ Object
4419 4420 4421 |
# File 'lib/hash_delegator.rb', line 4419 def setup @hd = HashDelegator.new end |
#test_block_find_with_default ⇒ Object
4435 4436 4437 4438 4439 4440 |
# File 'lib/hash_delegator.rb', line 4435 def test_block_find_with_default blocks = [FCB.new(text: 'value1'), FCB.new(text: 'value2')] result = HashDelegator.block_find(blocks, :text, 'missing_value', 'default') assert_equal 'default', result end |
#test_block_find_with_match ⇒ Object
4423 4424 4425 4426 4427 |
# File 'lib/hash_delegator.rb', line 4423 def test_block_find_with_match blocks = [FCB.new(text: 'value1'), FCB.new(text: 'value2')] result = HashDelegator.block_find(blocks, :text, 'value1') assert_equal('value1', result.text) end |
#test_block_find_without_match ⇒ Object
4429 4430 4431 4432 4433 |
# File 'lib/hash_delegator.rb', line 4429 def test_block_find_without_match blocks = [FCB.new(text: 'value1'), FCB.new(text: 'value2')] result = HashDelegator.block_find(blocks, :text, 'missing_value') assert_nil result end |