Sha256: 41dcaec8fbe3a9888acf1890e197ad4fe5601eee2b05437f5fbb775c05f5ef0f

Contents?: true

Size: 975 Bytes

Versions: 10

Compression:

Stored size: 975 Bytes

Contents

require File.dirname(__FILE__) + '/../shared/adapters/adapter'

namespace :testbot do
  
  def run_and_show_results(adapter, custom_path)
    Rake::Task["testbot:before_request"].invoke
        
    require File.expand_path(File.join(File.dirname(__FILE__), '..', 'requester', 'requester.rb'))
    requester = Testbot::Requester::Requester.create_by_config("#{Rails.root}/config/testbot.yml")

    puts "Running #{adapter.pluralized}..."
    start_time = Time.now
    
    path = custom_path ? "#{adapter.base_path}/#{custom_path}" : adapter.base_path
    success = requester.run_tests(adapter, path)
    
    puts
    puts requester.result_lines.join("\n")
    puts
    puts "Finished in #{Time.now - start_time} seconds."
    success
  end
  
  Adapter.all.each do |adapter|

    desc "Run the #{adapter.name} tests using testbot"
    task adapter.type, :custom_path do |_, args|
      exit 1 unless run_and_show_results(adapter, args[:custom_path])
    end
    
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
testbot-0.5.6 lib/tasks/testbot.rake
testbot-0.5.5 lib/tasks/testbot.rake
testbot-0.5.4 lib/tasks/testbot.rake
testbot-0.5.3 lib/tasks/testbot.rake
testbot-0.5.2 lib/tasks/testbot.rake
testbot-0.5.1 lib/tasks/testbot.rake
testbot-0.5.0 lib/tasks/testbot.rake
testbot-0.4.9 lib/tasks/testbot.rake
testbot-0.4.8 lib/tasks/testbot.rake
testbot-0.4.7 lib/tasks/testbot.rake