Sha256: 7e18f9f7dced6c2a333c73607d49008a8dc11cb7ea8bb7156ca02ff7768c2ffd

Contents?: true

Size: 1.62 KB

Versions: 49

Compression:

Stored size: 1.62 KB

Contents

# Configure Rails Environment
ENV['RAILS_ENV'] = 'test'

require 'rubygems'
require 'bundler'
Bundler.setup(:default, :test)

# Require simplecov before loading ..dummy/config/environment.rb because it will cause metasploit_data_models/lib to
# be loaded, which would result in Coverage not recording hits for any of the files.
require 'simplecov'
require 'coveralls'

if ENV['TRAVIS'] == 'true'
  # don't generate local report as it is inaccessible on travis-ci, which is why coveralls is being used.
  SimpleCov.formatter = Coveralls::SimpleCov::Formatter
else
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
      # either generate the local report
      SimpleCov::Formatter::HTMLFormatter
  ]
end

require File.expand_path('../dummy/config/environment.rb',  __FILE__)
require 'rspec/rails'
require 'rspec/autorun'

# full backtrace in logs so its easier to trace errors
Rails.backtrace_cleaner.remove_silencers!

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.

engines = [
    Metasploit::Concern::Engine,
    Metasploit::Model::Engine,
    MetasploitDataModels::Engine
]

engines.each do |engine|
  support_glob = engine.root.join('spec', 'support', '**', '*.rb')

  Dir.glob(support_glob) do |path|
    require path
  end
end

RSpec.configure do |config|
  config.before(:each) do
    # Rex is only available when testing with metasploit-framework or pro, so stub out the methods that require it
    Mdm::Workspace.any_instance.stub(:valid_ip_or_range? => true)
  end

  config.mock_with :rspec
  config.use_transactional_fixtures = true
  config.order = :random
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
metasploit_data_models-0.24.5 spec/spec_helper.rb
metasploit_data_models-0.24.1 spec/spec_helper.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0b spec/spec_helper.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0a spec/spec_helper.rb
metasploit_data_models-0.24.0 spec/spec_helper.rb
metasploit_data_models-0.23.3.pre.autoload spec/spec_helper.rb
metasploit_data_models-0.23.2 spec/spec_helper.rb
metasploit_data_models-0.23.2-java spec/spec_helper.rb
metasploit_data_models-0.23.1 spec/spec_helper.rb
metasploit_data_models-0.23.1-java spec/spec_helper.rb
metasploit_data_models-0.23.0 spec/spec_helper.rb
metasploit_data_models-0.23.0-java spec/spec_helper.rb
metasploit_data_models-0.22.8 spec/spec_helper.rb
metasploit_data_models-0.22.8-java spec/spec_helper.rb
metasploit_data_models-0.22.7 spec/spec_helper.rb
metasploit_data_models-0.22.7-java spec/spec_helper.rb
metasploit_data_models-0.22.6 spec/spec_helper.rb
metasploit_data_models-0.22.6-java spec/spec_helper.rb
metasploit_data_models-0.22.5 spec/spec_helper.rb
metasploit_data_models-0.22.5-java spec/spec_helper.rb