1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#!/usr/bin/env ruby
#This script requires a standard directory hierarchy which might be a bit cumbersome to set up
#
#The hierarchy looks like this near the leaves:
#...
#|-test_subclass_1
#| |-test_1
#| | |-input.scss
#| | --expected_output.css
#| --test_2
#| |-input.scss
#| --expected_output.css
#|-test_subclass_2
#| |-test_1
#| | |-input.scss
#| | --expected_output.css
#...
#the point is to have all the tests in their own folder in a file named input* with
#the output of running a command on it in the file expected_output* in the same directory
require_relative 'lib/sass_spec'
module Minitest
class Skip < Assertion
def result_code
"-"
end
end
end
if ARGV[0] == "annotate"
require_relative 'lib/sass_spec/annotate'
begin
(cli = SassSpec::Annotate::CLI.parse(ARGV[1..-1])) || exit(1)
rescue OptionParser::InvalidOption => e
warn e.message + "\n\n"
SassSpec::Annotate::CLI.parse(%w(-h))
exit 1
end
cli.annotate || exit(1)
else
begin
SassSpec::Runner.new(SassSpec::CLI.parse()).run || exit(1)
rescue ArgumentError => e
warn e.message
warn e.backtrace
exit 1
end
end
|