Class: Spork::TestFramework::Riot

Inherits:
Spork::TestFramework
  • Object
show all
Defined in:
lib/spork/test_framework/riot.rb

Constant Summary collapse

DEFAULT_PORT =
8988
HELPER_FILE =
File.join(Dir.pwd, "test/teststrap.rb")

Instance Method Summary collapse

Instance Method Details

#parse_options(argv) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/spork/test_framework/riot.rb', line 21

def parse_options(argv)
  paths, opts = argv.slice_before("--").to_a
  paths ||= []
  opts ||= []
  opts.shift
  [paths, opts]
end

#run_tests(argv, stderr, stdout) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/spork/test_framework/riot.rb', line 5

def run_tests(argv, stderr, stdout)
  $LOAD_PATH << "test" << "."

  paths, opts = parse_options(argv)

  paths.each do |path|
    if File.directory?(path)
      Dir["#{path.chomp('/')}/**/*_test.rb"].each { |f| require f }
    else
      require path
    end
  end

  ::Riot.run.success?
end