Class: MarkdownExec::TestHashDelegatorYieldToBlock
- Defined in:
- lib/hash_delegator.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_yield_to_block_if_applicable_with_correct_conditions ⇒ Object
- #test_yield_to_block_if_applicable_with_incorrect_conditions ⇒ Object
- #test_yield_to_block_if_applicable_without_block ⇒ Object
Instance Method Details
#setup ⇒ Object
7216 7217 7218 7219 7220 |
# File 'lib/hash_delegator.rb', line 7216 def setup @hd = HashDelegator.new @fcb = mock('Fcb') MarkdownExec::Filter.stubs(:fcb_select?).returns(true) end |
#test_yield_to_block_if_applicable_with_correct_conditions ⇒ Object
7222 7223 7224 7225 7226 7227 7228 7229 7230 |
# File 'lib/hash_delegator.rb', line 7222 def test_yield_to_block_if_applicable_with_correct_conditions block_called = false Filter.yield_to_block_if_applicable(@fcb, [:blocks]) do |type, fcb| block_called = true assert_equal :blocks, type assert_equal @fcb, fcb end assert block_called end |
#test_yield_to_block_if_applicable_with_incorrect_conditions ⇒ Object
7237 7238 7239 7240 7241 7242 7243 7244 |
# File 'lib/hash_delegator.rb', line 7237 def test_yield_to_block_if_applicable_with_incorrect_conditions block_called = false MarkdownExec::Filter.stubs(:fcb_select?).returns(false) Filter.yield_to_block_if_applicable(@fcb, [:non_blocks]) do |_| block_called = true end refute block_called end |
#test_yield_to_block_if_applicable_without_block ⇒ Object
7232 7233 7234 7235 |
# File 'lib/hash_delegator.rb', line 7232 def test_yield_to_block_if_applicable_without_block result = Filter.yield_to_block_if_applicable(@fcb, [:blocks]) assert_nil result end |