Sha256: ca97f6c0c190097d01c11c7f97f58e7815d3636fe364987485572612e156231f

Contents?: true

Size: 954 Bytes

Versions: 1

Compression:

Stored size: 954 Bytes

Contents

config = YAML.load_file("#{Rails.root}/vendor/plugins/telekom_api/config/api_runner.yaml")

namespace :api do
  namespace :run do
    config.each_key do |env|
      desc "runs a series of nessecary api calls and parses their response in environment #{env}"
      task env.to_sym => :environment do
        puts "Running API tests in environment #{env}"
        api_runner = ApiRunner.new(env)
        api_runner.run
        puts "\nTestrun finished\n\n"
      end
    end
  end
  desc "generates configuration and a skeleton for apirunner tests as well as excludes"
  task :scaffold do
    FileUtils.mkdir_p( "test/api_runner" )
    FileUtils.mkdir_p( "config" )
    FileUtils.cp_r( "#{APIRUNNER_ROOT}/examples/config", ".")
    FileUtils.cp_r( "#{APIRUNNER_ROOT}/examples/test", ".")
    puts "created the following files:"
    Dir.glob("#{APIRUNNER_ROOT}/examples/**/*").each do |file|
      puts "\t#{file.gsub(/.*examples\//, '')}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apirunner-0.0.12 lib/tasks/api.rake