Sha256: cbd215e5f3c88961361e04e840d5094099facc687b2da2323171fe1cff847321

Contents?: true

Size: 852 Bytes

Versions: 1

Compression:

Stored size: 852 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'thor'
require 'English'
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')

# Executable for Generic Test
class Exe < Thor
  desc 'page page_url', 'Test web page'
  def page(page_url)
    ENV['PAGE_URL'] = page_url
    test_file_path = File.join(File.dirname(__FILE__), '..', 'spec', 'generic_test_spec.rb')
    raise "no file at #{test_file_path}" unless File.exist? test_file_path

    desc = ENV['PAGE_URL'].split('://').last.tr('/', '_')
    junit_format = "-f RspecJunitFormatter --out logs/page_#{desc}.xml"
    ENV['REPORT_PATH'] = "reports/#{desc}"
    html_format = "-f RspecHtmlReporter"
    command = "rspec #{test_file_path} --format documentation --color #{junit_format} #{html_format}"
    raise $CHILD_STATUS.to_s unless system command
  end
end

Exe.start(ARGV)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
generic_test-0.1.7 exe/generic_test