Sha256: 2b029fd2e5a6d5af022b557685a122333ecba65e161c797415bb995caf6b60d6

Contents?: true

Size: 1015 Bytes

Versions: 1

Compression:

Stored size: 1015 Bytes

Contents

require 'omnibus'
require 'fauxhai'

module Omnibus
  module RSpec
    SPEC_DATA = File.expand_path(File.join(File.dirname(__FILE__), 'data'))

    def software_path(name)
      File.join(SPEC_DATA, 'software', "#{name}.rb")
    end

    def overrides_path(name)
      File.join(SPEC_DATA, 'overrides', "#{name}.overrides")
    end

    def project_path(name)
      File.join(SPEC_DATA, 'projects', "#{name}.rb")
    end

    def fixtures_path
      File.expand_path('../fixtures', __FILE__)
    end

    def tmp_path
      File.expand_path('../../tmp', __FILE__)
    end
  end
end

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

  # Clear the tmp_path on each run
  config.before(:each) do
    FileUtils.rm_rf(tmp_path)
    FileUtils.mkdir_p(tmp_path)
  end

  # Force the expect syntax
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omnibus-3.0.0 spec/spec_helper.rb