Sha256: 1eeea219f77c72f3de0fa881c3ff9d2bd5b51185d8a19d381f2baa76fb570cb2

Contents?: true

Size: 748 Bytes

Versions: 38

Compression:

Stored size: 748 Bytes

Contents

shared_examples_for 'search_attribute' do |name, options={}|
  options.assert_valid_keys(:type)
  type = options.fetch(:type)

  it_should_behave_like 'search_with',
                        Metasploit::Model::Search::Operator::Attribute,
                        :attribute => name,
                        :name => name,
                        :type => type

  if type.is_a? Hash
    parent_type, _child_type = type.first

    if parent_type == :set
      attribute_set_method_name = "#{name}_set"

      context attribute_set_method_name do
        subject(attribute_set_method_name) do
          base_class.send(attribute_set_method_name)
        end

        it { should be_a Set }
        it { should_not be_empty }
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
metasploit-model-1.0.0.pre.rails.pre.4.0 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.30.0 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.30.0-java spec/support/shared/examples/search_attribute.rb
metasploit-model-0.29.2 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.29.2-java spec/support/shared/examples/search_attribute.rb
metasploit-model-0.29.0 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.29.0-java spec/support/shared/examples/search_attribute.rb
metasploit-model-0.28.0 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.28.0-java spec/support/shared/examples/search_attribute.rb
metasploit-model-0.28.0.pre.engine.pre.requires spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.4 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.4-java spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.3 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.3-java spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.2 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.2-java spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.1 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.1-java spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.0 spec/support/shared/examples/search_attribute.rb
metasploit-model-0.27.0-java spec/support/shared/examples/search_attribute.rb