Sha256: ea3c60ae8ceae1f3133e8ae8ede5558f95f5b79f789f2eaaf44cf70e15a91d7e

Contents?: true

Size: 960 Bytes

Versions: 38

Compression:

Stored size: 960 Bytes

Contents

shared_examples_for 'search query' do |options={}|
  options.assert_valid_keys(:formatted_operator)

  formatted_operator = options.fetch(:formatted_operator)

  context "with #{formatted_operator}" do
    subject(:query) do
      Metasploit::Model::Search::Query.new(
          :formatted => formatted,
          :klass => base_class
      )
    end

    let(:formatted) do
      "#{formatted_operator}:\"#{formatted_value}\""
    end

    let(:formatted_value) do
      "formatted_value"
    end

    context 'operations' do
      subject(:operations) do
        query.operations
      end

      context 'operator with matching name' do
        subject(:operator) do
          operation.operator
        end

        let(:operation) do
          operations.find { |operation|
            operation.operator.name == formatted_operator.to_sym
          }
        end

        it { should_not be_nil }
        it { should be_valid }
      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/query.rb
metasploit-model-0.30.0 spec/support/shared/examples/search/query.rb
metasploit-model-0.30.0-java spec/support/shared/examples/search/query.rb
metasploit-model-0.29.2 spec/support/shared/examples/search/query.rb
metasploit-model-0.29.2-java spec/support/shared/examples/search/query.rb
metasploit-model-0.29.0 spec/support/shared/examples/search/query.rb
metasploit-model-0.29.0-java spec/support/shared/examples/search/query.rb
metasploit-model-0.28.0 spec/support/shared/examples/search/query.rb
metasploit-model-0.28.0-java spec/support/shared/examples/search/query.rb
metasploit-model-0.28.0.pre.engine.pre.requires spec/support/shared/examples/search/query.rb
metasploit-model-0.27.4 spec/support/shared/examples/search/query.rb
metasploit-model-0.27.4-java spec/support/shared/examples/search/query.rb
metasploit-model-0.27.3 spec/support/shared/examples/search/query.rb
metasploit-model-0.27.3-java spec/support/shared/examples/search/query.rb
metasploit-model-0.27.2 spec/support/shared/examples/search/query.rb
metasploit-model-0.27.2-java spec/support/shared/examples/search/query.rb
metasploit-model-0.27.1 spec/support/shared/examples/search/query.rb
metasploit-model-0.27.1-java spec/support/shared/examples/search/query.rb
metasploit-model-0.27.0 spec/support/shared/examples/search/query.rb
metasploit-model-0.27.0-java spec/support/shared/examples/search/query.rb