#!/usr/bin/env ruby # frozen_string_literal: true require 'thor' $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') require 'generic_test' # Executable for Generic Test class Exe < Thor desc 'page page_url', 'Test web page' def page(page_url) ENV['PAGE_URL'] = page_url puts File.join(File.dirname(__FILE__)) test_file_path = File.join(Dir.pwd, File.dirname(__FILE__), '..', 'spec', 'generic_test_spec.rb') puts 'no file' unless File.exist? test_file_path command = "rspec #{test_file_path} --format documentation --require generic_test/setup" puts command #require_relative '../lib/generic_test/setup' system command # "rspec #{test_file_path} --format documentation --require generic_test" #puts `rspec #{test_file_path} --format documentation --require generic_test` end end Exe.start(ARGV)