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

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/hashie-3.6.0/spec/support/integration_specs.rb
hashie-4.0.0 spec/support/integration_specs.rb
hashie-3.6.0 spec/support/integration_specs.rb
tdiary-5.0.8 vendor/bundle/gems/hashie-3.5.7/spec/support/integration_specs.rb
hashie-3.5.7 spec/support/integration_specs.rb
hashie-3.5.6 spec/support/integration_specs.rb
tdiary-5.0.5 vendor/bundle/gems/hashie-3.5.5/spec/support/integration_specs.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/hashie-3.5.5/spec/support/integration_specs.rb
tdiary-5.0.4 vendor/bundle/gems/hashie-3.5.5/spec/support/integration_specs.rb
hashie-3.5.5 spec/support/integration_specs.rb
hashie-3.5.4 spec/support/integration_specs.rb
hashie-3.5.3 spec/support/integration_specs.rb
hashie-3.5.2 spec/support/integration_specs.rb