Sha256: db4dbc1385d45adf103a7968dd3fd6a03c41fd66e01a19b11f4def2efc769d49

Contents?: true

Size: 1.96 KB

Versions: 19

Compression:

Stored size: 1.96 KB

Contents

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

begin
  require 'simplecov'
  SimpleCov.start
rescue LoadError
end

require 'stringio'
require 'clamp'
require 'ruby_dig'
require 'kontena_cli'
require 'webmock/rspec'

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.filter_run :focus

  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = 'random'
  config.before(:each) do
    allow(Dir).to receive(:home).and_return('/tmp/')
    allow(ENV).to receive(:[]).with(anything).and_call_original
    allow(ENV).to receive(:[]).with('DEBUG').and_call_original
    Kontena::Cli::Config.reset_instance
  end

  config.after(:each) do
    RSpec::Mocks.space.proxy_for(File).reset
    RSpec::Mocks.space.proxy_for(Kontena::Cli::Config).reset
    File.unlink(Kontena::Cli::Config.default_config_filename) if File.exist?(Kontena::Cli::Config.default_config_filename)
  end

  config.around(:each) do |example|
    catch :exit_with_error do
      begin
        example.run
      rescue SystemExit
        puts "Got SystemExit: #{$!.message} - Exit code: #{$!.status}"
      end
    end
  end

  unless ENV["DEBUG"]
    config.before(:each) do
      $stdout = StringIO.new
      $stderr = StringIO.new
    end

    config.after(:each) do
      $stdout = STDOUT
      $stderr = STDERR
    end
  end
end

require_relative 'support/client_helpers'
require_relative 'support/requirements_helper'
require_relative 'support/fixtures_helpers'
require_relative 'support/output_helpers'
require_relative 'support/exit_with_error_helper'

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
kontena-cli-1.3.5 spec/spec_helper.rb
kontena-cli-1.3.5.rc1 spec/spec_helper.rb
kontena-cli-1.3.4 spec/spec_helper.rb
kontena-cli-1.3.4.rc1 spec/spec_helper.rb
kontena-cli-1.3.3 spec/spec_helper.rb
kontena-cli-1.3.3.rc1 spec/spec_helper.rb
kontena-cli-1.3.2 spec/spec_helper.rb
kontena-cli-1.3.2.rc2 spec/spec_helper.rb
kontena-cli-1.3.2.rc1 spec/spec_helper.rb
kontena-cli-1.3.1 spec/spec_helper.rb
kontena-cli-1.3.1.rc2 spec/spec_helper.rb
kontena-cli-1.3.1.rc1 spec/spec_helper.rb
kontena-cli-1.3.0 spec/spec_helper.rb
kontena-cli-1.3.0.rc4 spec/spec_helper.rb
kontena-cli-1.3.0.rc3 spec/spec_helper.rb
kontena-cli-1.3.0.rc2 spec/spec_helper.rb
kontena-cli-1.3.0.rc1 spec/spec_helper.rb
kontena-cli-1.3.0.pre2 spec/spec_helper.rb
kontena-cli-1.3.0.pre1 spec/spec_helper.rb