lib/proxy_tester/cli/main.rb in proxy_tester-0.0.1 vs lib/proxy_tester/cli/main.rb in proxy_tester-0.0.2

- old
+ new

@@ -5,22 +5,29 @@ class_option :config_file, type: :string, desc: 'Config file' class_option :log_level, type: :string, desc: 'Log level for ui logging' class_option :debug_mode, type: :boolean, desc: 'Run application in debug mode' desc 'test', 'Run tests' + subcommand 'test', Cli::Test + + desc 'add SOURCE', 'Add new testcases by cloning them via vcs' + option :force, type: :boolean, default: false, desc: 'Overwrite existing files?' option :test_cases_directory, type: :string, desc: 'Directory with test cases' - option :tags, type: :array, desc: 'Filter tests based on tags' - def test + def add(source) ProxyTester.config = ProxyTester::Config.new(options[:config_file]) if options[:config_file] + ProxyTester.config.log_level = options[:log_level] if options[:log_level] ProxyTester.config.debug_mode = options[:debug_mode] if options[:debug_mode] ProxyTester.config.test_cases_directory = options[:test_cases_directory] if options[:test_cases_directory] ProxyTester.config.lock ProxyTester.ui_logger.level = ProxyTester.config.log_level ProxyTester.enable_debug_mode if ProxyTester.config.debug_mode - ProxyTester::RspecRunner.new.run(options[:tags]) + ProxyTester.ui_logger.debug('Options: ' + options.to_s) + ProxyTester.ui_logger.debug("Config:\n" + ProxyTester.config.to_s) + + Actions::AddTestCase.new(RemoteRepository.new(source), ProxyTester.config.test_cases_directory, force: options[:force]).run end desc 'init', 'Create files/directories to use proxy_tester' option :force, type: :boolean, default: false, desc: 'Overwrite existing files?' option :pre_seed, type: :boolean, default: false, desc: 'Add examples to test cases directory'