Sha256: 4fa43319818c01d80fae205d04868f1e0ec2fed6f7b44795e3105e05c634d311

Contents?: true

Size: 1.59 KB

Versions: 11

Compression:

Stored size: 1.59 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,
    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

11 entries across 11 versions & 1 rubygems

Version Path
metasploit_data_models-0.19.0 spec/spec_helper.rb
metasploit_data_models-0.19.0-java spec/spec_helper.rb
metasploit_data_models-0.18.1-java spec/spec_helper.rb
metasploit_data_models-0.18.1 spec/spec_helper.rb
metasploit_data_models-0.18.0 spec/spec_helper.rb
metasploit_data_models-0.18.0-java spec/spec_helper.rb
metasploit_data_models-0.18.0.pre.compatibility spec/spec_helper.rb
metasploit_data_models-0.17.3-java spec/spec_helper.rb
metasploit_data_models-0.17.3 spec/spec_helper.rb
metasploit_data_models-0.17.3.pre.metasploit.pre.concern-java spec/spec_helper.rb
metasploit_data_models-0.17.3.pre.metasploit.pre.concern spec/spec_helper.rb