shared_context -> RSpec.shared_context

MSP-13484

shared_context must be qualified as global patching is disabled in
spec_helper.
This commit is contained in:
Luke Imhoff 2015-10-20 09:54:02 -05:00 committed by Brent Cook
parent 2b02b9e081
commit fc9ca84da5
10 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@ require 'spec_helper'
require 'rex/proto/http/client_request'
shared_context "with no evasions" do
RSpec.shared_context "with no evasions" do
before(:each) do
client_request.opts['uri_dir_self_reference'] = false
client_request.opts['uri_fake_params_start'] = false
@ -17,7 +17,7 @@ shared_context "with no evasions" do
end
shared_context "with 'uri_dir_self_reference'" do
RSpec.shared_context "with 'uri_dir_self_reference'" do
before(:each) do
client_request.opts['uri_dir_self_reference'] = true
end
@ -29,7 +29,7 @@ shared_context "with 'uri_dir_self_reference'" do
end
shared_context "with 'uri_dir_fake_relative'" do
RSpec.shared_context "with 'uri_dir_fake_relative'" do
before(:each) do
client_request.opts['uri_dir_fake_relative'] = true
end
@ -42,7 +42,7 @@ shared_context "with 'uri_dir_fake_relative'" do
end
shared_context "with 'uri_full_url'" do
RSpec.shared_context "with 'uri_full_url'" do
before(:each) do
client_request.opts['uri_full_url'] = true

View File

@ -1,5 +1,5 @@
# Use in a context to clean up the constants that are created by the module loader.
shared_context 'Metasploit::Framework::Spec::Constants cleaner' do
RSpec.shared_context 'Metasploit::Framework::Spec::Constants cleaner' do
after(:each) do
Metasploit::Framework::Spec::Constants.clean
end

View File

@ -1,4 +1,4 @@
shared_context 'Msf::DBManager' do
RSpec.shared_context 'Msf::DBManager' do
include_context 'Msf::Simple::Framework'
let(:active) do

View File

@ -1,4 +1,4 @@
shared_context 'Msf::Framework#threads cleaner' do
RSpec.shared_context 'Msf::Framework#threads cleaner' do
after(:each) do |example|
unless framework.threads?
fail RuntimeError.new(

View File

@ -1,5 +1,5 @@
# -*- coding:binary -*-
shared_context 'Msf::Modules::Error attributes' do
RSpec.shared_context 'Msf::Modules::Error attributes' do
let(:causal_message) do
'rspec'
end

View File

@ -1,5 +1,5 @@
# -*- coding:binary -*-
shared_context "Msf::Modules::Loader::Base" do
RSpec.shared_context "Msf::Modules::Loader::Base" do
let(:parent_path) do
parent_pathname.to_s
end

View File

@ -2,7 +2,7 @@
require 'msf/base/simple/framework'
require 'metasploit/framework'
shared_context 'Msf::Simple::Framework' do
RSpec.shared_context 'Msf::Simple::Framework' do
let(:dummy_pathname) do
Rails.root.join('spec', 'dummy')
end

View File

@ -24,7 +24,7 @@
# )
# }
#
shared_context 'Msf::Simple::Framework#modules loading' do
RSpec.shared_context 'Msf::Simple::Framework#modules loading' do
include_context 'Metasploit::Framework::Spec::Constants cleaner'
include_context 'Msf::Simple::Framework'

View File

@ -1,4 +1,4 @@
shared_context 'Msf::UIDriver' do
RSpec.shared_context 'Msf::UIDriver' do
let(:driver) do
double(
'Driver',

View File

@ -36,7 +36,7 @@
# @param options [Hash{Symbol => Pathname}]
# @option options [Pathname] :modules_pathname Pathname of `modules` directory underwhich payloads are defined on the
# file system.
shared_context 'untested payloads' do |options={}|
RSpec.shared_context 'untested payloads' do |options={}|
options.assert_valid_keys(:modules_pathname)
modules_pathname = options.fetch(:modules_pathname)