Sha256: 71629885e4878723cf6d54389aea24e058d8f3e0d63d0e1f4a95f8ee3bada584
Contents?: true
Size: 1.2 KB
Versions: 13
Compression:
Stored size: 1.2 KB
Contents
# Generates the bundle command for running an integration test # # @param [String] integration the integration folder to run # @param [String] command the command to run # @return [String] def integration_command(integration, command) "#{integration_gemfile(integration)} #{command}" end # Generates the Gemfile for an integration # # @param [String] integration the integration test name # @return [String] def integration_gemfile(integration) "BUNDLE_GEMFILE=#{integration_path(integration)}/Gemfile" end # Generates the path to the integration # # @param [String] integration the integration test name # @return [String] def integration_path(integration) "spec/integration/#{integration}" end # Runs all integration specs in their own environment def run_all_integration_specs(handler: ->(_code) {}, logger: ->(_msg) {}) Dir['spec/integration/*'] .map { |directory| directory.split('/').last } .each do |integration| logger.call(%(Running "#{integration}" integration spec)) system(integration_command(integration, 'bundle --quiet')) system(integration_command(integration, "bundle exec rspec #{integration_path(integration)}")) handler.call($CHILD_STATUS.exitstatus) end end
Version data entries
13 entries across 12 versions & 3 rubygems