Sha256: 8bda504af79d482a731ae7589d90f518ac653307c8352e43c525fb63e917641c

Contents?: true

Size: 843 Bytes

Versions: 63

Compression:

Stored size: 843 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
    visitor.attribute_visitor.should_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')
    visitor.attribute_visitor.stub(:visit).with(operator).and_return(attribute)

    attribute.should_receive(:eq).with(value)

    visit
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
metasploit_data_models-0.20.0-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.8 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.8-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.7 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.7-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.4 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.4-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.3-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.3 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.0 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.19.0-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.18.1-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.18.1 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.18.0 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.18.0-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.18.0.pre.compatibility spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.17.3-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.17.3 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.17.3.pre.metasploit.pre.concern-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.17.3.pre.metasploit.pre.concern spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb