exe/test_diff in test_diff-0.4.2 vs exe/test_diff in test_diff-0.5.0

- old
+ new

@@ -4,28 +4,38 @@ require 'test_diff' # thor class to allow execution class TestDiffBuilder < Thor - desc 'build_coverage spec', 'runs the specs and generates reverse_coverage' - def build_coverage(spec_folder = 'spec', pre_load = nil, continue = nil) - TestDiff::BuildCoverage.new(spec_folder, pre_load, continue).run + desc 'build_coverage spec', 'runs the specs and generates coverage index' + method_option :spec_folder, desc: 'Folder where specs located', default: 'spec', type: :string, banner: 'spec' + method_option :stop_on_failure, desc: 'Stop building coverage if spec fails', default: false, type: :boolean + method_option :only_missing, desc: 'build coverage for missing specs', default: false, type: :boolean + def build_coverage(pre_load = nil) + TestDiff::BuildCoverage.new(options[:spec_folder], + pre_load, + options[:stop_on_failure], + options[:only_missing]) + .run track_build end desc 'track build', 'track this HEAD as the last test diff index' def track_build(git_dir = nil, sha1 = nil) TestDiff::TrackBuild.new(sha1, git_dir).run end desc 'rspec', 'runs the specs difference between the branches' - def rspec(spec_folder = 'spec', groups_of = nil, group = '0') - TestDiff::RunDiff.new(spec_folder, groups_of, group).run + method_option :spec_folder, desc: 'Folder where specs located', default: 'spec', type: :string, banner: 'spec' + def rspec(groups_of = nil, group = '0') + TestDiff::RunDiff.new(options[:spec_folder], groups_of, group).run end - desc 'build_coverage_diff spec', 'runs the specs difference between the branches' - def build_coverage_diff(spec_folder = 'spec', pre_load = nil, continue = nil) - TestDiff::BuildCoverageDiff.new(spec_folder, pre_load, continue).run + desc 'build_coverage_diff spec', 'runs the specs difference and updates coverage index' + method_option :spec_folder, desc: 'Folder where specs located', default: 'spec', type: :string, banner: 'spec' + method_option :stop_on_failure, desc: 'Stop building coverage if spec fails', default: false, type: :boolean + def build_coverage_diff(pre_load = nil) + TestDiff::BuildCoverageDiff.new(options[:spec_folder], pre_load, options[:stop_on_failure]).run track_build end end TestDiffBuilder.start(ARGV)