Sha256: d028f37e649430758fbba94d7e8b8d249a238239e1bbb35d1747d4796c040ab2

Contents?: true

Size: 936 Bytes

Versions: 73

Compression:

Stored size: 936 Bytes

Contents

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

73 entries across 73 versions & 1 rubygems

Version Path
metasploit-credential-1.0.1 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.8 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-1.0.0 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.7 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.6 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-1.0.0.pre.rails.pre.4.0c spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-1.0.0.pre.rails.pre.4.0b spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-1.0.0.pre.rails.pre.4.0 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.5 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.4 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.3 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.2 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.1 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.14.0 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.13.19 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.13.18 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.13.17 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.13.16 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.13.15 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb
metasploit-credential-0.13.12 spec/support/shared/contexts/metasploit/credential/search/operation/type.rb