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.24.5 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.24.1 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0b spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-1.0.0.pre.rails.pre.4.0a spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.24.0 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.23.3.pre.autoload spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.23.2 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.23.2-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.23.1 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.23.1-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.23.0 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.23.0-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.22.8 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.22.8-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.22.7 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.22.7-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.22.6 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.22.6-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.22.5 spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
metasploit_data_models-0.22.5-java spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb