exe/generic_test in generic_test-0.1.5 vs exe/generic_test in generic_test-0.1.7
- old
+ new
@@ -1,21 +1,25 @@
#!/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
- command = "rspec #{test_file_path} --format documentation --require generic_test/setup --color --format RspecJunitFormatter --out logs/page_#{desc}.xml"
- system command
+ 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)
\ No newline at end of file