Sha256: a37eb1b1c5a5bd4b3baeed7b06d4f63fbeb28331b871e15f99445e3f8ef59e8f

Contents?: true

Size: 1.68 KB

Versions: 1

Compression:

Stored size: 1.68 KB

Contents

module ArubaHelper
  include Aruba::Api

  def r(command)
    run_simple File.expand_path("../../fixtures/bin/#{command}", __FILE__), true, @timeout
  end

  def fixture(path)
    Pathname(__FILE__).dirname.join('../fixtures').join path
  end

  def self.included(base)
    base.before :each, :"disable-bundler" do
      unset_bundler_env_vars
    end

    base.before :each do
      @__aruba_original_paths = (ENV['PATH'] || '').split(File::PATH_SEPARATOR)
      ENV['PATH'] = ([File.expand_path('bin')] + @__aruba_original_paths).join(File::PATH_SEPARATOR)
      ENV['backtrace'] = 'true'
      set_env "HOME", File.expand_path(current_dir)
    end

    base.after :each do
      ENV['PATH'] = @__aruba_original_paths.join(File::PATH_SEPARATOR)
    end

    base.before :each do
      FileUtils.rm_rf(current_dir) unless example.metadata[:"no-clobber"]
    end

    base.before :each do
      @timeout = example.options[:timeout]
    end

    base.before :each, :puts do
      @puts = true
    end

    base.before :each, :"announce-cmd" do
      @announce_cmd = true
    end

    base.before :each, :"announce-dir" do
      @announce_dir = true
    end

    base.before :each, :"announce-stdout" do
      @announce_stdout = true
    end

    base.before :each, :"announce-stderr" do
      @announce_stderr = true
    end

    base.before :each, :"announce-env" do
      @announce_end = true
    end

    base.before :each, :announce do
      @announce_stdout = true
      @announce_stderr = true
      @announce_cmd = true
      @announce_dir = true
      @announce_env = true
    end

    base.before :each, :ansi do
      @aruba_keep_ansi = true
    end

    base.after :each do
      restore_env
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mvcli-0.1.0 spec/support/aruba_helper.rb