Sha256: 470d13bc036933343f34108e2628c7b70e17b3f2981a896341e456e00462c5cf

Contents?: true

Size: 1.29 KB

Versions: 31

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe Metasploit::Model::Search::Operator::Deprecated::App do
  subject(:operator) do
    described_class.new(
        :klass => klass
    )
  end

  let(:klass) do
    Class.new
  end

  it { should be_a Metasploit::Model::Search::Operator::Delegation }

  context 'CONSTANTS' do
    context 'STANCE_BY_APP' do
      subject(:stance_by_app) do
        described_class::STANCE_BY_APP
      end

      its(['client']) { should == 'passive' }
      its(['server']) { should == 'aggressive' }
    end
  end

  context '#operate_on' do
    subject(:operation) do
      operator.operate_on(formatted_value)
    end

    let(:stance_operator) do
      Metasploit::Model::Search::Operator::Attribute.new(
          :attribute => :stance,
          :klass => klass,
          :type => :string
      )
    end

    before(:each) do
      operator.stub(:operator).with('stance').and_return(stance_operator)
    end

    context 'with client' do
      let(:formatted_value) do
        'client'
      end

      its('operator.name') { should == :stance }
      its(:value) { should == 'passive' }
    end

    context 'with server' do
      let(:formatted_value) do
        'server'
      end

      its('operator.name') { should == :stance }
      its(:value) { should == 'aggressive' }
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
metasploit-model-0.28.0 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.28.0-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.28.0.pre.engine.pre.requires spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.4 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.4-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.3 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.3-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.2 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.2-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.1 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.1-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.0 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.0-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.27.0.pre.dep.pre.railties spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.26.1-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.26.1 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.25.7 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.25.7-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.25.6 spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb
metasploit-model-0.25.6-java spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb