Sha256: d384796078b49906e9ff8df19141c75e5816c2f2c5776f2aa2f8e80d6ec91d49
Contents?: true
Size: 1.25 KB
Versions: 31
Compression:
Stored size: 1.25 KB
Contents
shared_examples_for 'Metasploit::Model::Authority seed' do |attributes={}| attributes.assert_valid_keys(:abbreviation, :extension_name, :obsolete, :summary, :url) abbreviation = attributes.fetch(:abbreviation) context "with #{abbreviation}" do subject(:seed) do seed_with_abbreviation(abbreviation) end it 'should exist' do seed.should_not be_nil end its(:obsolete) { should == attributes.fetch(:obsolete) } its(:summary) { should == attributes.fetch(:summary) } its(:url) { should == attributes.fetch(:url) } extension_name = attributes.fetch(:extension_name) if extension_name context 'with extension' do let(:designation) do double('Designation') end let(:extension) do extension_name.constantize end its(:extension) { should == extension } it 'should have extension be a defined class' do expect { extension }.to_not raise_error end it 'should delegate #designation_url to extension' do extension.should_receive(:designation_url).with(designation) seed.designation_url(designation) end end else its(:extension) { should be_nil } end end end
Version data entries
31 entries across 31 versions & 1 rubygems