Sha256: 16880147fd8561ce4579cf25e6b624f159112bcf06a6c5cc5de16ea2d61aef2e

Contents?: true

Size: 993 Bytes

Versions: 26

Compression:

Stored size: 993 Bytes

Contents

shared_examples_for 'Metasploit::Model::Search::Operation::String::Value' do
  let(:operation_class) do
    described_class
  end

  context '#class' do
    subject do
      operation_class
    end

    it { should include Metasploit::Model::Search::Operation::String::Value }
  end

  context '#value' do
    subject(:value) do
      operation.value
    end

    let(:operation) do
      operation_class.new(:value => formatted_value)
    end

    context 'with Integer' do
      let(:formatted_value) do
        5
      end

      it 'should convert to String' do
        value.should == '5'
      end
    end

    context 'with String' do
      let(:formatted_value) do
        'a string'
      end

      it 'should pass through String' do
        value.should == formatted_value
      end
    end

    context 'with Symbol' do
      let(:formatted_value) do
        :a_symbol
      end

      it 'should convert to String' do
        value.should == 'a_symbol'
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
metasploit-model-0.25.1-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.24.1-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.24.1 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.24.1.pre.semantic.pre.versioning.pre.2.pre.0 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb