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.27.3 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.27.3-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.27.2 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.27.2-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.27.1 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.27.1-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.27.0 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.27.0-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.27.0.pre.dep.pre.railties spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.26.1-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.26.1 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.7 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.7-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.6 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.6-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.3 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.3-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.2 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.2-java spec/support/shared/examples/metasploit/model/search/operation/string/value.rb
metasploit-model-0.25.1 spec/support/shared/examples/metasploit/model/search/operation/string/value.rb