diff --git a/lib/sass_spec/cli.rb b/lib/sass_spec/cli.rb index dae3dd5a18..ac36e41b5e 100644 --- a/lib/sass_spec/cli.rb +++ b/lib/sass_spec/cli.rb @@ -6,6 +6,7 @@ def self.parse options = { sass_executable: "sass", spec_directory: "spec", + tap: false, skip: false, verbose: false, filter: "", @@ -41,6 +42,10 @@ def self.parse options[:verbose] = true end + opts.on("-t", "--tap", "Output TAP compatible report") do + options[:tap] = true + end + opts.on("-c", "--command COMMAND", "Sets a specific binary to run (defaults to '#{options[:sass_executable]}')") do |v| options[:sass_executable] = v end diff --git a/lib/sass_spec/runner.rb b/lib/sass_spec/runner.rb index cd5430494e..79bcaa47d2 100644 --- a/lib/sass_spec/runner.rb +++ b/lib/sass_spec/runner.rb @@ -11,9 +11,8 @@ def initialize(options = {}) end def run - unless @options[:silent] + unless @options[:silent] || @options[:tap] puts "Recursively searching under directory '#{@options[:spec_directory]}' for test files to test '#{@options[:sass_executable]}' with." - stdout, stderr, status = Open3.capture3("#{@options[:sass_executable]} -v") puts stdout end @@ -26,6 +25,11 @@ def run minioptions.push '--verbose' end + if @options[:tap] + require 'minitap' + Minitest.reporter = Minitap::TapY + end + exit Minitest.run(minioptions) end