module RTest::MainTest

Public Instance Methods

run() click to toggle source
# File lib/rtest/main_test.rb, line 14
def run
  files = RTest::FileGetter.files_from_args
  files.each { |file| process_file(file) }
  run_tests
end
run_tests() click to toggle source
# File lib/rtest/main_test.rb, line 10
def run_tests
  @@tests.each { |test| test.run }
end
tests() click to toggle source
# File lib/rtest/main_test.rb, line 20
def tests
  @@tests
end
the(message, optional_message = '', &block) click to toggle source
# File lib/rtest/main_test.rb, line 6
def the(message, optional_message = '', &block)
  @@tests << RTest::NestedTest.new(message, optional_message, &block)
end

Private Instance Methods

add_dir_to_load_path(file) click to toggle source
# File lib/rtest/main_test.rb, line 34
def add_dir_to_load_path(file)
  path = file_full_path(file)
  $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
end
file_full_path(file) click to toggle source
# File lib/rtest/main_test.rb, line 30
def file_full_path(file)
  File.dirname(File.expand_path(file))
end
process_file(file) click to toggle source
# File lib/rtest/main_test.rb, line 25
def process_file(file)
  add_dir_to_load_path(file)
  eval(File.read(file)) 
end