Sha256: 937c68005a7bfd1d633d42a9ef3561e0b4a3856e57502a85fe34dbe2c918c48c

Contents?: true

Size: 934 Bytes

Versions: 22

Compression:

Stored size: 934 Bytes

Contents

RSpec.describe Metasploit::Model::Association::Error do
  context '#initialize' do
    let(:attributes) do
      {
          :model => model,
          :name => :associated_things
      }
    end

    let(:model) do
      Class.new
    end

    context 'without :model' do
      before(:example) do
        attributes.delete(:model)
      end

      it 'should raise KeyError' do
        expect {
          described_class.new(attributes)
        }.to raise_error(KeyError)
      end
    end

    context 'without :name' do
      before(:example) do
        attributes.delete(:name)
      end

      it 'should raise KeyError' do
        expect {
          described_class.new(attributes)
        }.to raise_error(KeyError)
      end
    end

    context 'with :model and :name' do
      it 'should not raise error' do
        expect {
          described_class.new(attributes)
        }.to_not raise_error
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
metasploit-model-5.0.2 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-5.0.1 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-5.0.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-4.0.6 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-4.0.5 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-4.0.4 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-4.0.3 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-4.0.2 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-4.0.1 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-4.0.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-3.1.4 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-3.1.3 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-3.1.2 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-3.1.1 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-3.1.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-3.0.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-2.0.4 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-2.0.3 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-2.0.2 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-2.0.1 spec/lib/metasploit/model/association/error_spec.rb