Sha256: ae9467dfd98648e71275fc2ac635692df7a7bf034715d6650b61cdeed7691168

Contents?: true

Size: 883 Bytes

Versions: 8

Compression:

Stored size: 883 Bytes

Contents

RSpec.describe Metasploit::Model::Search::Operator::Null, type: :model do
  subject(:operator) do
    described_class.new
  end

  it { is_expected.to be_a Metasploit::Model::Search::Operator::Single }

  context 'validations' do
    context 'name' do
      let(:error) do
        I18n.translate('metasploit.model.errors.models.metasploit/model/search/operator/null.attributes.name.unknown')
      end

      before(:each) do
        operator.valid?
      end

      it 'should record error' do
        expect(operator.errors[:name]).to include(error)
      end
    end
  end

  context '#type' do
    subject(:type) do
      operator.type
    end

    it { is_expected.to be_nil }
  end

  context '#operation_class' do
    subject(:operation_class) do
      operator.send(:operation_class)
    end

    it { is_expected.to eq(Metasploit::Model::Search::Operation::Null) }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metasploit-model-1.0.2 spec/app/models/metasploit/model/search/operator/null_spec.rb
metasploit-model-1.0.1 spec/app/models/metasploit/model/search/operator/null_spec.rb
metasploit-model-1.0.0 spec/app/models/metasploit/model/search/operator/null_spec.rb
metasploit-model-0.30.2 spec/app/models/metasploit/model/search/operator/null_spec.rb
metasploit-model-0.30.2-java spec/app/models/metasploit/model/search/operator/null_spec.rb
metasploit-model-0.30.1 spec/app/models/metasploit/model/search/operator/null_spec.rb
metasploit-model-0.30.1-java spec/app/models/metasploit/model/search/operator/null_spec.rb
metasploit-model-0.30.1.pre.rspec.pre.3.pre.1 spec/app/models/metasploit/model/search/operator/null_spec.rb