Sha256: 526157228ef95b6901a7587066a0a174e010dd9eb182214da8cb6eec8af3f925

Contents?: true

Size: 864 Bytes

Versions: 18

Compression:

Stored size: 864 Bytes

Contents

shared_examples_for 'MetasploitDataModels::Search::Visitor::Where#visit with equality operation' do
  let(:node) do
    node_class.new(
        :operator => operator,
        :value => value
    )
  end

  let(:operator) do
    Metasploit::Model::Search::Operator::Attribute.new(
        # any class that responds to arel_table
        :klass => Mdm::Host
    )
  end

  let(:value) do
    "value"
  end

  it 'should visit operation.operator with attribute_visitor' do
    expect(visitor.attribute_visitor).to receive(:visit).with(operator).and_call_original

    visit
  end

  it 'should call eq on Arel::Attributes::Attribute from attribute_visitor' do
    attribute = double('Visited Operator')
    allow(visitor.attribute_visitor).to receive(:visit).with(operator).and_return(attribute)

    expect(attribute).to receive(:eq).with(value)

    visit
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
metasploit_data_models-1.2.10 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.9 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.8 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.7 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.6 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.5 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.4 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.3 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.2 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.24.4 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.1 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.2.0 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.1.0 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.0.1 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.0.0 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.24.3 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.24.2 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.24.1.pre.rspec.pre.3.pre.1 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb