#!/usr/bin/env ruby

if ARGV.empty?
  puts "You must provide a directory or file to run"
  exit
end

require 'find'
require File.dirname(__FILE__) + "/../lib/spec"

context_runner = Spec::Runner::ContextRunner.new(ARGV)
Spec::Runner::Context.context_runner = context_runner

ARGV.each do |file|
  Find.find(file) do |path|
    if FileTest.file?(path) and File.extname(path) == '.rb'
      require path
    end
  end
end

context_runner.run

