Sha256: 9b62dfecb236510bafdafdd68d57c224774c952083016bc2b65846cee212319b

Contents?: true

Size: 942 Bytes

Versions: 49

Compression:

Stored size: 942 Bytes

Contents

RSpec.shared_examples_for 'Metasploit::Credential::Search::Operation::Type' do |options={}|
  options.assert_valid_keys(:attribute, :matching_class)

  attribute = options.fetch(:attribute, :type)
  matching_class = options.fetch(:matching_class)

  context "with #{matching_class}" do
    let(:matching_class) {
      matching_class
    }

    context "with #{attribute}" do
      let(:formatted) {
        %Q{#{attribute}:"#{value}"}
      }

      context 'with Class#name' do
        let(:value) {
          matching_class.name
        }

        it 'should find only matching record' do
          expect(visit).to match_array([matching_record])
        end
      end

      context 'with Class#model_name.human' do
        let(:value) {
          matching_class.model_name.human
        }

        it 'should find only matching record' do
          expect(visit).to match_array([matching_record])
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
metasploit-credential-6.0.11 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.10 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.9 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.8 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.7 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.6 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.5 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.4 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.3 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.2 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.1 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-6.0.0 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-5.0.9 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-5.0.8 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-5.0.7 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-5.0.6 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-5.0.5 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-5.0.4 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-5.0.3 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-5.0.2 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb