| Module | CoreEx::EmbeddedTests |
| In: |
lib/core_ex/embedded_tests.rb
|
# File lib/core_ex/embedded_tests.rb, line 15 def embedded_test_mode ( aRegexp ) raise 'No block needed' if block_given? require 'test/unit' @@embedded_test_mode = aRegexp end
# File lib/core_ex/embedded_tests.rb, line 35 def run_embedded_test_sections @@embedded_test_blocks.each do |block| Kernel.instance_eval(&block) end end
# File lib/core_ex/embedded_tests.rb, line 25 def test_section ( __file__, &block ) __file__ = ::Pathname.new(__file__).expand_path if block_given? and __file__.to_s =~ @@embedded_test_mode unless @@embedded_test_files.include?(__file__) @@embedded_test_blocks << block @@embedded_test_files << __file__ end end end