Class: ChemistryKit::CLI::CKitCLI
- Inherits:
-
Thor
- Object
- Thor
- ChemistryKit::CLI::CKitCLI
- Defined in:
- lib/chemistrykit/cli/cli.rb
Overview
Main Chemistry Kit CLI Class
Instance Method Summary collapse
Instance Method Details
#brew ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/chemistrykit/cli/cli.rb', line 79 def brew config = load_config ['config'] # TODO: perhaps the params should be rolled into the available # config object injected into the system? pass_params if ['params'] # replace certain config values with run time flags as needed config = override_configs , config load_page_objects # get those beakers that should be executed beakers = ['beakers'] ? ['beakers'] : Dir.glob(File.join(Dir.getwd, 'beakers/*')) if ['beakers'] # if a beaker(s) defined use them beakers = ['beakers'] # if tags are explicity defined, apply them to the selected beakers (['tag']) else # beakers default to everything beakers = Dir.glob(File.join(Dir.getwd, 'beakers/*')) if ['tag'] # if tags are explicity defined, apply them to all beakers (['tag']) else # else choose the default tag (['depth:shallow']) end end # configure rspec rspec_config(config) # based on concurrency parameter run tests if config.concurrency > 1 && ! ['parallel'] exit_code = run_in_parallel beakers, config.concurrency, @tags, else exit_code = run_rspec beakers end process_html unless ['parallel'] exit_code unless ['parallel'] end |
#tags ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/chemistrykit/cli/cli.rb', line 47 def beakers = Dir.glob(File.join(Dir.getwd, 'beakers/*')) ::RSpec.configure do |c| c.add_setting :used_tags c.before(:suite) { ::RSpec.configuration. = [] } c.around(:each) do |example| standard_keys = [:example_group, :example_group_block, :description_args, :caller, :execution_result, :full_description] example..each do |key, value| tag = "#{key}:#{value}" unless standard_keys.include?(key) ::RSpec.configuration..push tag unless ::RSpec.configuration..include?(tag) || tag.nil? end end c.after(:suite) do puts "\nTags used in harness:\n\n" puts ::RSpec.configuration..sort end end ::RSpec::Core::Runner.run(beakers) end |