Sha256: 778b1aad0649133bbb1f6225000afd14de8089e258d55d613304788d13394fa3

Contents?: true

Size: 1.08 KB

Versions: 31

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe Metasploit::Model::Authority::Waraxe do
  context 'CONSTANTS' do
    context 'DESIGNATION_REGEXP' do
      subject(:designation_regexp) do
        described_class::DESIGNATION_REGEXP
      end

      let(:designation) do
        FactoryGirl.generate :metasploit_model_reference_waraxe_designation
      end

      it 'should match sequence' do
        designation.should match(designation_regexp)
      end
    end
  end

  context 'designation_url' do
    subject(:designation_url) do
      described_class.designation_url(designation)
    end

    context 'with designation that matches DESIGNATION_URL' do
      let(:designation) do
        "#{year}-SA##{number}"
      end

      let(:number) do
        103
      end

      let(:year) do
        2013
      end

      it 'should be under bid directory' do
        designation_url.should == "http://www.waraxe.us/advisory-#{number}.html"
      end
    end

    context 'without designation that matches DESIGNATION_URL' do
      let(:designation) do
        '#103'
      end

      it { should be_nil }
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
metasploit-model-0.28.0 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.28.0-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.28.0.pre.engine.pre.requires spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.4 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.4-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.3 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.3-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.2 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.2-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.1 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.1-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.0 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.0-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.27.0.pre.dep.pre.railties spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.26.1-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.26.1 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.7 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.7-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.6 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.6-java spec/lib/metasploit/model/authority/waraxe_spec.rb