Sha256: 9b03019abd19df4ba4416d14fdb90307f0b02d763d040c93cb161f2940bb5e38

Contents?: true

Size: 945 Bytes

Versions: 38

Compression:

Stored size: 945 Bytes

Contents

require 'spec_helper'

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(:each) 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(:each) 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

38 entries across 38 versions & 1 rubygems

Version Path
metasploit-model-1.0.0.pre.rails.pre.4.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.30.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.30.0-java spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.29.2 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.29.2-java spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.29.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.29.0-java spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.28.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.28.0-java spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.28.0.pre.engine.pre.requires spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.4 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.4-java spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.3 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.3-java spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.2 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.2-java spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.1 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.1-java spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.0 spec/lib/metasploit/model/association/error_spec.rb
metasploit-model-0.27.0-java spec/lib/metasploit/model/association/error_spec.rb