Sha256: 3888c9046e89d14101d890007db3e11f87a416f904aa6538f93ac2f0c308e046

Contents?: true

Size: 859 Bytes

Versions: 15

Compression:

Stored size: 859 Bytes

Contents

shared_examples_for 'Metasploit::Concern.run' do
  let(:load_hook_name) {
    described_class.name.underscore.gsub('/', '_').to_sym
  }

  let(:loaded_bases_by_name) {
    ActiveSupport.module_eval { @loaded }
  }

  context 'with correct base' do
    it 'calls ActiveSupport.run_load_hooks with correct load hook name' do
      actual_names = []

      loaded_bases_by_name.each do |name, bases|
        bases.each do |base|
          if base == described_class
            actual_names << name
            break
          end
        end
      end

      expect(actual_names).to include(load_hook_name)
    end
  end

  context 'with correct load hook name' do
    it 'calls ActiveSupport.run_load_hooks with correct base' do
      actual_bases = loaded_bases_by_name[load_hook_name]

      expect(actual_bases).to include(described_class)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
metasploit-concern-1.0.0 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-1.0.0.pre.rails.pre.4.0 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.5.1 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.5.0 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.4.0 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.4.0.pre.app.pre.concerns.pre.eager.pre.load spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.3.1 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.3.1.pre.autoload.pre.compatibility spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.3.0 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.3.0.pre.engine.pre.requires spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.2.1 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.2.1.pre.dep.pre.railties spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.1.1 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.1.0 spec/support/shared/examples/metasploit/concern/run.rb
metasploit-concern-0.0.4 spec/support/shared/examples/metasploit/concern/run.rb